From 16e5788011d60393c6e702b418262bf96c15daa3 Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 14 Mar 2017 12:09:52 +0100 Subject: [PATCH] Call the callback if we can't parse the local Drive to import it --- www/common/mergeDrive.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/www/common/mergeDrive.js b/www/common/mergeDrive.js index 70149467b..f056fedee 100644 --- a/www/common/mergeDrive.js +++ b/www/common/mergeDrive.js @@ -138,7 +138,15 @@ define([ var todo = function (err, doc) { if (err) { console.error("Cannot migrate recent pads", err); return; } var parsed; - try { parsed = JSON.parse(doc); } catch (e) { console.error("Cannot parsed recent pads", e); return; } + if (!doc) { + if (typeof(cb) === "function") { cb(); } + return; + } + try { parsed = JSON.parse(doc); } catch (e) { + if (typeof(cb) === "function") { cb(); } + console.error("Cannot parsed recent pads", e); + return; + } if (parsed) { //merge(proxy, parsed, true); var oldFo = FO.init(parsed.drive, {