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

Handle missing projects runtime setting

This commit is contained in:
Nick O'Leary 2020-06-02 22:53:05 +01:00
parent f0193b0f67
commit dec82589d1
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -395,7 +395,7 @@ function createProject(user, metadata) {
} }
function setActiveProject(user, projectName) { function setActiveProject(user, projectName) {
return loadProject(projectName).then(function(project) { return loadProject(projectName).then(function(project) {
var globalProjectSettings = settings.get("projects"); var globalProjectSettings = settings.get("projects")||{};
globalProjectSettings.activeProject = project.name; globalProjectSettings.activeProject = project.name;
return settings.set("projects",globalProjectSettings).then(function() { return settings.set("projects",globalProjectSettings).then(function() {
log.info(log._("storage.localfilesystem.projects.changing-project",{project:(activeProject&&activeProject.name)||"none"})); log.info(log._("storage.localfilesystem.projects.changing-project",{project:(activeProject&&activeProject.name)||"none"}));