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() {
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;