From b824f87e7e6c2b692237fa29771b1c37f3330b6c Mon Sep 17 00:00:00 2001 From: Sergey Astanin Date: Wed, 3 Feb 2016 15:29:27 +0100 Subject: [PATCH] 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. --- src/sync.d | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/sync.d b/src/sync.d index 1ce728f6..a169d0ab 100644 --- a/src/sync.d +++ b/src/sync.d @@ -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;