continue if there is an edit command for an item we don't have (just print a warning)
continue if there is an edit command for an item we don't have (just print a warning)
--- a/services/sync/modules/stores.js
+++ b/services/sync/modules/stores.js
@@ -107,24 +107,24 @@ Store.prototype = {
// override only if neccessary
_itemExists: function Store__itemExists(GUID) {
if (GUID in this._lookup)
return true;
else
return false;
},
-
+
// override these in derived objects
-
+
// wrap MUST save the wrapped store in the _lookup property!
wrap: function Store_wrap() {
throw "wrap needs to be subclassed";
},
-
+
wipe: function Store_wipe() {
throw "wipe needs to be subclassed";
},
_resetGUIDs: function Store__resetGUIDs() {
let self = yield;
throw "_resetGUIDs needs to be subclassed";
},
@@ -196,17 +196,20 @@ SnapshotStore.prototype = {
if (("parentGUID" in this._data[GUID]) &&
(this._data[GUID].parentGUID == oldGUID))
this._data[GUID].parentGUID = newGUID;
}
}
for (let prop in command.data) {
if (prop == "GUID")
continue;
- this._data[command.GUID][prop] = command.data[prop];
+ if (command.GUID in this._data)
+ this._data[command.GUID][prop] = command.data[prop];
+ else
+ this._log.warn("Warning! Edit command for unknown item: " + command.GUID);
}
},
save: function SStore_save() {
this._log.info("Saving snapshot to disk");
let file = Utils.getProfileFile(
{path: "weave/snapshots/" + this.filename,