mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Fix context admin api for empty contexts
This commit is contained in:
parent
9bbe405cd0
commit
4e4a1f11e6
@ -50,15 +50,19 @@ module.exports = {
|
||||
ctx.keys(function(err, keys) {
|
||||
var result = {};
|
||||
var c = keys.length;
|
||||
keys.forEach(function(key) {
|
||||
ctx.get(key,function(err, v) {
|
||||
result[key] = util.encodeObject({msg:v});
|
||||
c--;
|
||||
if (c === 0) {
|
||||
res.json(result);
|
||||
}
|
||||
if (c === 0) {
|
||||
res.json(result);
|
||||
} else {
|
||||
keys.forEach(function(key) {
|
||||
ctx.get(key,function(err, v) {
|
||||
result[key] = util.encodeObject({msg:v});
|
||||
c--;
|
||||
if (c === 0) {
|
||||
res.json(result);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user