1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Don't assume node has defaults when exporting icon property

This commit is contained in:
Nick O'Leary 2018-02-01 22:28:05 +00:00
parent ead841d844
commit a8fc5b01f3
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
2 changed files with 2 additions and 2 deletions

View File

@ -19,7 +19,7 @@ Node Fixes
- Add HEAD to list of methods with no body in http req node #1598 - Add HEAD to list of methods with no body in http req node #1598
- Do not include payload in GET requests Fixes #1598 - Do not include payload in GET requests Fixes #1598
- Update sort/batch docs Fixes #1601 - Update sort/batch docs Fixes #1601
- Don't assume node has defaults when exporting icon property
#### 0.18: Milestone Release #### 0.18: Milestone Release

View File

@ -501,7 +501,7 @@ RED.nodes = (function() {
if (n.outputs > 0 && n.outputLabels && !/^\s*$/.test(n.outputLabels.join(""))) { if (n.outputs > 0 && n.outputLabels && !/^\s*$/.test(n.outputLabels.join(""))) {
node.outputLabels = n.outputLabels.slice(); node.outputLabels = n.outputLabels.slice();
} }
if (!n._def.defaults.hasOwnProperty("icon") && n.icon) { if ((!n._def.defaults || !n._def.defaults.hasOwnProperty("icon")) && n.icon) {
var defIcon = RED.utils.getDefaultNodeIcon(n._def, n); var defIcon = RED.utils.getDefaultNodeIcon(n._def, n);
if (n.icon !== defIcon.module+"/"+defIcon.file) { if (n.icon !== defIcon.module+"/"+defIcon.file) {
node.icon = n.icon; node.icon = n.icon;