diff --git a/nodes/core/logic/10-switch.js b/nodes/core/logic/10-switch.js index 8bcb85718..0cd1dc626 100644 --- a/nodes/core/logic/10-switch.js +++ b/nodes/core/logic/10-switch.js @@ -35,10 +35,10 @@ module.exports = function(RED) { function SwitchNode(n) { RED.nodes.createNode(this, n); - this.rules = n.rules; + this.rules = n.rules || []; this.property = n.property; this.checkall = n.checkall || "true"; - var propertyParts = n.property.split("."); + var propertyParts = (n.property || "payload").split("."); var node = this; for (var i=0; i