From a250ed855e55bf0659ea9cee0b3c9c74e0321389 Mon Sep 17 00:00:00 2001 From: Arunoda Susiripala Date: Wed, 31 Jul 2013 06:58:01 +0530 Subject: [PATCH] fixed callbackOrDummy to play with null --- node-phantom.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/node-phantom.js b/node-phantom.js index 96cb7a8..43ab55e 100644 --- a/node-phantom.js +++ b/node-phantom.js @@ -5,9 +5,10 @@ var socketio=require('socket.io'); var child=require('child_process'); function callbackOrDummy(callback){ - if(callback===undefined)callback=function(){}; + if(!callback) callback=function(){}; return callback; } + function unwrapArray(arr) { return arr && arr.length == 1 ? arr[0] : arr }