protect against subtly corrupted user objects

pull/1/head
ansuz 8 years ago
parent 7908f3b4f0
commit 9b4b642d4a

@ -295,7 +295,7 @@ define([
paths.push(p); paths.push(p);
} }
}; };
if (path.length === 1) { if (path.length === 1 && typeof(root) === 'object') {
Object.keys(root).forEach(function (key) { Object.keys(root).forEach(function (key) {
var arr = root[key]; var arr = root[key];
if (!Array.isArray(arr)) { return; } if (!Array.isArray(arr)) { return; }

@ -152,6 +152,7 @@ define([
var oldFo = FO.init(parsed.drive, { var oldFo = FO.init(parsed.drive, {
Cryptpad: Cryptpad Cryptpad: Cryptpad
}); });
oldFo.fixFiles();
var newData = Cryptpad.getStore().getProxy(); var newData = Cryptpad.getStore().getProxy();
var newFo = newData.fo; var newFo = newData.fo;
var newRecentPads = proxy.drive[Cryptpad.storageKey]; var newRecentPads = proxy.drive[Cryptpad.storageKey];

Loading…
Cancel
Save