diff --git a/red/runtime/nodes/context/localfilesystem.js b/red/runtime/nodes/context/localfilesystem.js index dc25b6290..548c98c60 100644 --- a/red/runtime/nodes/context/localfilesystem.js +++ b/red/runtime/nodes/context/localfilesystem.js @@ -230,14 +230,31 @@ LocalFileSystem.prototype.get = function(scope, key, callback) { } var storagePath = getStoragePath(this.storageBaseDir ,scope); loadFile(storagePath + ".json").then(function(data){ + var value; if(data){ data = JSON.parse(data); if (!Array.isArray(key)) { - callback(null, util.getObjectProperty(data,key)); + try { + value = util.getObjectProperty(data,key); + } catch(err) { + if (err.code === "INVALID_EXPR") { + throw err; + } + value = undefined; + } + callback(null, value); } else { var results = [undefined]; for (var i=0;i