mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Handle blank config file
This commit is contained in:
parent
1f95071a37
commit
31255bd66b
@ -215,7 +215,11 @@ var localfilesystem = {
|
|||||||
getSettings: function() {
|
getSettings: function() {
|
||||||
if (fs.existsSync(globalSettingsFile)) {
|
if (fs.existsSync(globalSettingsFile)) {
|
||||||
return nodeFn.call(fs.readFile,globalSettingsFile,'utf8').then(function(data) {
|
return nodeFn.call(fs.readFile,globalSettingsFile,'utf8').then(function(data) {
|
||||||
|
if (data) {
|
||||||
return JSON.parse(data);
|
return JSON.parse(data);
|
||||||
|
} else {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return when.resolve({});
|
return when.resolve({});
|
||||||
|
Loading…
Reference in New Issue
Block a user