From 114f6d53e42b137396ca5a99d9556512ca875135 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 2 Jan 2014 14:51:20 +0000 Subject: [PATCH] refactor(console) handler --- lib/client/console.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/client/console.js b/lib/client/console.js index 92a79499..883c3d84 100644 --- a/lib/client/console.js +++ b/lib/client/console.js @@ -54,12 +54,11 @@ var CloudCmd, Util, DOM, CloudFunc, $; // Handle a command. var handler = function(command) { - var lSocket = CloudCmd.Socket; - if (command) { + var socket = CloudCmd.Socket; + + if (command && socket) { Images.showLoad({ top:true }); - - if(lSocket) - lSocket.send(command); + socket.send(command); } jqconsole.Prompt(true, handler);