mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Clone settings before passing to storage layer
Avoids the storage layer modifying the in-memory object
This commit is contained in:
parent
1a4d720978
commit
bb4330e486
@ -92,7 +92,7 @@ var persistentSettings = {
|
|||||||
assert.deepEqual(current,value);
|
assert.deepEqual(current,value);
|
||||||
return when.resolve();
|
return when.resolve();
|
||||||
} catch(err) {
|
} catch(err) {
|
||||||
return storage.saveSettings(globalSettings);
|
return storage.saveSettings(clone(globalSettings));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
delete: function(prop) {
|
delete: function(prop) {
|
||||||
@ -104,7 +104,7 @@ var persistentSettings = {
|
|||||||
}
|
}
|
||||||
if (globalSettings.hasOwnProperty(prop)) {
|
if (globalSettings.hasOwnProperty(prop)) {
|
||||||
delete globalSettings[prop];
|
delete globalSettings[prop];
|
||||||
return storage.saveSettings(globalSettings);
|
return storage.saveSettings(clone(globalSettings));
|
||||||
}
|
}
|
||||||
return when.resolve();
|
return when.resolve();
|
||||||
},
|
},
|
||||||
@ -183,7 +183,7 @@ var persistentSettings = {
|
|||||||
return when.resolve();
|
return when.resolve();
|
||||||
} catch(err) {
|
} catch(err) {
|
||||||
globalSettings.users = userSettings;
|
globalSettings.users = userSettings;
|
||||||
return storage.saveSettings(globalSettings);
|
return storage.saveSettings(clone(globalSettings));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user