Catch very early exit null pointer when ctrl-c hit during startup.

This commit is contained in:
dceejay 2015-03-02 17:32:22 +00:00
parent 971a62ebc9
commit 81dcfecb4e
1 changed files with 8 additions and 5 deletions

View File

@ -139,14 +139,18 @@ var flowNodes = module.exports = {
} }
} }
} }
}, },
stopFlows: function() { stopFlows: function() {
log.info("Stopping flows"); log.info("Stopping flows");
if (activeFlow) {
return activeFlow.stop().then(function() { return activeFlow.stop().then(function() {
log.info("Stopped flows"); log.info("Stopped flows");
return; return;
}); });
} else {
log.info("Stopped");
return;
}
}, },
handleError: function(node,logMessage,msg) { handleError: function(node,logMessage,msg) {
activeFlow.handleError(node,logMessage,msg); activeFlow.handleError(node,logMessage,msg);
@ -154,4 +158,3 @@ var flowNodes = module.exports = {
}; };
var activeFlow = null; var activeFlow = null;