mirror of
https://github.com/abraunegg/onedrive
synced 2024-06-03 06:22:18 +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()
|
JSONValue upload()
|
||||||
{
|
{
|
||||||
long offset = session["nextExpectedRanges"][0].str.splitter('-').front.to!long;
|
long offset;
|
||||||
long fileSize = getSize(session["localPath"].str);
|
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
|
// Upload Progress Bar
|
||||||
size_t iteration = (roundTo!int(double(fileSize)/double(fragmentSize)))+1;
|
size_t iteration = (roundTo!int(double(fileSize)/double(fragmentSize)))+1;
|
||||||
|
|
Loading…
Reference in a new issue