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"}) + }) + } } }); }