diff --git a/red/nodes/Flow.js b/red/nodes/Flow.js index 259b7debf..65f643cac 100644 --- a/red/nodes/Flow.js +++ b/red/nodes/Flow.js @@ -462,8 +462,10 @@ Flow.prototype.typeRegistered = function(type) { if (this.missingTypes.length === 0 && this.started) { this.start(); } + return true; } } + return false; } diff --git a/red/nodes/flows.js b/red/nodes/flows.js index 29a04312c..b50c16241 100644 --- a/red/nodes/flows.js +++ b/red/nodes/flows.js @@ -34,8 +34,7 @@ var activeConfig = []; var activeConfigNodes = {}; events.on('type-registered',function(type) { - if (activeFlow) { - activeFlow.typeRegistered(type); + if (activeFlow && activeFlow.typeRegistered(type)) { log.info("Missing type registered: "+type); } }); diff --git a/test/red/nodes/Flow_spec.js b/test/red/nodes/Flow_spec.js index 964f2f31b..78576dbd4 100644 --- a/test/red/nodes/Flow_spec.js +++ b/test/red/nodes/Flow_spec.js @@ -141,11 +141,16 @@ describe('Flow', function() { flow.getMissingTypes().should.eql(["test1","test2"]); - flow.typeRegistered("test1"); + var resp = flow.typeRegistered("a-random-node"); + resp.should.be.false; + + resp = flow.typeRegistered("test1"); + resp.should.be.true; flow.getMissingTypes().should.eql(["test2"]); flowStart.called.should.be.false; - flow.typeRegistered("test2"); + resp = flow.typeRegistered("test2"); + resp.should.be.true; flow.getMissingTypes().should.eql([]); flowStart.called.should.be.false; } finally {