1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Catch file-not-found on startup when non-existant flow file specified

This commit is contained in:
Nick O'Leary 2018-12-13 10:59:03 +00:00
parent 8c561e92c8
commit 8bb861124d
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -137,6 +137,7 @@ function init(_settings, _runtime) {
saveSettings = true;
} else {
// if it resolves to a dir - use it
try {
var stat = fs.statSync(fspath.join(projectsDir,settings.flowFile));
if (stat && stat.isDirectory()) {
activeProject = settings.flowFile;
@ -149,6 +150,9 @@ function init(_settings, _runtime) {
saveSettings = true;
}
}
} catch(err) {
// Doesn't exist, handle as a flow file to be created
}
}
}
if (!activeProject) {