fix for crash when command parameters is not an array
authorJack Allnutt <m2ys4u@Gmail.com>
Tue, 31 Jul 2012 21:57:29 +0000 (22:57 +0100)
committerJack Allnutt <m2ys4u@Gmail.com>
Tue, 31 Jul 2012 21:57:29 +0000 (22:57 +0100)
server/client.js

index dd94ec4deae34be63a90c8980fd192a6e53586f7..4276043c77eb1e5110b25d6650cde673fb4a4ba2 100755 (executable)
@@ -64,6 +64,10 @@ var IRC_command = function (command, callback) {
     
     command.data = JSON.parse(command.data);
     
+    if (!_.isArray(command.data.args.params)){
+        command.data.args.params = [command.data.args.params];
+    }
+    
     if (command.data.method === 'ctcp') {
         if (command.data.args.request) {
             str += 'PRIVMSG ';