diff --git a/www/common/fileObject.js b/www/common/fileObject.js index 7fbdf045b..57d029b9d 100644 --- a/www/common/fileObject.js +++ b/www/common/fileObject.js @@ -295,7 +295,7 @@ define([ paths.push(p); } }; - if (path.length === 1) { + if (path.length === 1 && typeof(root) === 'object') { Object.keys(root).forEach(function (key) { var arr = root[key]; if (!Array.isArray(arr)) { return; } diff --git a/www/common/mergeDrive.js b/www/common/mergeDrive.js index f056fedee..688f1cedc 100644 --- a/www/common/mergeDrive.js +++ b/www/common/mergeDrive.js @@ -152,6 +152,7 @@ define([ var oldFo = FO.init(parsed.drive, { Cryptpad: Cryptpad }); + oldFo.fixFiles(); var newData = Cryptpad.getStore().getProxy(); var newFo = newData.fo; var newRecentPads = proxy.drive[Cryptpad.storageKey];