diff --git a/red/runtime/nodes/registry/registry.js b/red/runtime/nodes/registry/registry.js index 5372d7be6..8f2239dea 100644 --- a/red/runtime/nodes/registry/registry.js +++ b/red/runtime/nodes/registry/registry.js @@ -599,6 +599,9 @@ function getNodeIconPath(module,icon) { } } } + if (module !== "node-red") { + return getNodeIconPath("node-red", icon); + } return defaultIcon; } diff --git a/test/red/runtime/nodes/registry/registry_spec.js b/test/red/runtime/nodes/registry/registry_spec.js index 12bb9a8b4..828609aa7 100644 --- a/test/red/runtime/nodes/registry/registry_spec.js +++ b/test/red/runtime/nodes/registry/registry_spec.js @@ -497,6 +497,12 @@ describe("red/nodes/registry/registry",function() { var iconPath = typeRegistry.getNodeIconPath('test-module','test_icon.png'); iconPath.should.eql(testIcon); }); + + it('returns the debug icon when getting an unknown module', function() { + var debugIcon = path.resolve(__dirname+'/../../../../../public/icons/debug.png'); + var iconPath = typeRegistry.getNodeIconPath('unknown-module', 'debug.png'); + iconPath.should.eql(debugIcon); + }); }); });