From 81dcfecb4ecc5f545b65d7b4948908a4ea9d6307 Mon Sep 17 00:00:00 2001 From: dceejay Date: Mon, 2 Mar 2015 17:32:22 +0000 Subject: [PATCH] Catch very early exit null pointer when ctrl-c hit during startup. --- red/nodes/flows.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/red/nodes/flows.js b/red/nodes/flows.js index d7ec8caf6..f1946e8fe 100644 --- a/red/nodes/flows.js +++ b/red/nodes/flows.js @@ -139,14 +139,18 @@ var flowNodes = module.exports = { } } } - }, stopFlows: function() { log.info("Stopping flows"); - return activeFlow.stop().then(function() { - log.info("Stopped flows"); + if (activeFlow) { + return activeFlow.stop().then(function() { + log.info("Stopped flows"); + return; + }); + } else { + log.info("Stopped"); return; - }); + } }, handleError: function(node,logMessage,msg) { activeFlow.handleError(node,logMessage,msg); @@ -154,4 +158,3 @@ var flowNodes = module.exports = { }; var activeFlow = null; -