fix #24: crash on sync if cTag is missing

According to https://dev.onedrive.com/resources/item.htm
cTag property is not returned if the Item is a folder.
This commit is contained in:
Sergey Astanin 2016-02-03 15:29:27 +01:00
parent 7e3d36750a
commit b824f87e7e

View file

@ -180,7 +180,15 @@ final class SyncEngine
return;
}
string cTag = item["cTag"].str;
string cTag;
try {
cTag = item["cTag"].str;
} catch (JSONException e) {
// cTag is not returned if the Item is a folder
// https://dev.onedrive.com/resources/item.htm
cTag = "";
}
string mtime = item["fileSystemInfo"]["lastModifiedDateTime"].str;
string crc32;