From 5767478871abc533ea249c2c7096193c324bf521 Mon Sep 17 00:00:00 2001 From: Nicholas O'Leary Date: Tue, 3 Dec 2013 01:10:25 +0000 Subject: [PATCH] Switch node null/not null tests don't always work a === null / a !=== null is different to typeof a == "undefined" / typeof a != "undefined" --- nodes/core/logic/10-switch.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nodes/core/logic/10-switch.js b/nodes/core/logic/10-switch.js index c4c8d23b6..ac93e787f 100644 --- a/nodes/core/logic/10-switch.js +++ b/nodes/core/logic/10-switch.js @@ -28,8 +28,8 @@ var operators = { 'regex': function(a, b) { return (a + "").match(new RegExp(b)); }, 'true': function(a) { return a === true; }, 'false': function(a) { return a === false; }, - 'null': function(a) { return a === null; }, - 'nnull': function(a) { return a !== null; }, + 'null': function(a) { return typeof a == "undefined"; }, + 'nnull': function(a) { return typeof a != "undefined"; }, 'else': function(a) { return a === true; } };