From a8fc5b01f3d9c98f1191930cb895c59ce79fe001 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Thu, 1 Feb 2018 22:28:05 +0000 Subject: [PATCH] Don't assume node has defaults when exporting icon property --- CHANGELOG.md | 2 +- editor/js/nodes.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd31dce83..b488492b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +19,7 @@ Node Fixes - Add HEAD to list of methods with no body in http req node #1598 - Do not include payload in GET requests Fixes #1598 - Update sort/batch docs Fixes #1601 - + - Don't assume node has defaults when exporting icon property #### 0.18: Milestone Release diff --git a/editor/js/nodes.js b/editor/js/nodes.js index cdd1dfae7..b3c39fff1 100644 --- a/editor/js/nodes.js +++ b/editor/js/nodes.js @@ -501,7 +501,7 @@ RED.nodes = (function() { if (n.outputs > 0 && n.outputLabels && !/^\s*$/.test(n.outputLabels.join(""))) { 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); if (n.icon !== defIcon.module+"/"+defIcon.file) { node.icon = n.icon;