From 5489bd37c96501aed944c8a54fc9f1e5038deca6 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Fri, 8 Jan 2021 15:05:34 +0000 Subject: [PATCH] Fix handling of default workflow mode when projects not active --- .../lib/storage/localfilesystem/projects/index.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/projects/index.js b/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/projects/index.js index 2f2990e08..41d769fdd 100644 --- a/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/projects/index.js +++ b/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/projects/index.js @@ -580,11 +580,13 @@ function saveFlows(flows, user) { } return util.writeFile(flowsFullPath, flowData, flowsFileBackup).then(() => { var gitSettings = getUserGitSettings(user) || {}; - var workflowMode = (gitSettings.workflow||{}).mode || settings.editorTheme.projects.workflow.mode; - if (activeProject && workflowMode === 'auto') { - return activeProject.stageFile([flowsFullPath, credentialsFile]).then(() => { - return activeProject.commit(user,{message:"Update flow files"}) - }) + if (activeProject) { + var workflowMode = (gitSettings.workflow||{}).mode || settings.editorTheme.projects.workflow.mode; + if (workflowMode === 'auto') { + return activeProject.stageFile([flowsFullPath, credentialsFile]).then(() => { + return activeProject.commit(user,{message:"Update flow files"}) + }) + } } }); }