mirror of
https://github.com/abraunegg/onedrive
synced 2024-05-20 22:56:36 +02:00
* Dont 'assume' that the key value pairs exist. Check if they do before attempting to use them
This commit is contained in:
parent
98624267c5
commit
e849eb3de4
12
src/upload.d
12
src/upload.d
|
@ -111,8 +111,16 @@ struct UploadSession
|
|||
|
||||
JSONValue upload()
|
||||
{
|
||||
long offset = session["nextExpectedRanges"][0].str.splitter('-').front.to!long;
|
||||
long fileSize = getSize(session["localPath"].str);
|
||||
long offset;
|
||||
long fileSize;
|
||||
|
||||
if ("nextExpectedRanges" in session){
|
||||
offset = session["nextExpectedRanges"][0].str.splitter('-').front.to!long;
|
||||
}
|
||||
|
||||
if ("localPath" in session){
|
||||
fileSize = getSize(session["localPath"].str);
|
||||
}
|
||||
|
||||
// Upload Progress Bar
|
||||
size_t iteration = (roundTo!int(double(fileSize)/double(fragmentSize)))+1;
|
||||
|
|
Loading…
Reference in a new issue