]> git.scottworley.com Git - reliable-chat/commitdiff
/nick requires an argument
authorScott Worley <sworley@chkno.net>
Sun, 19 Aug 2012 18:31:23 +0000 (11:31 -0700)
committerScott Worley <sworley@chkno.net>
Sun, 19 Aug 2012 18:31:23 +0000 (11:31 -0700)
webclient/rc.html

index c1d36b26117bcbd58a969e1fe0d0a4360e97404d..4a956ea608bee4cbcb76a00a25cd90b65d863617 100644 (file)
                                        rcaddmessagetoUI({'Text': '-!- Your nick is already ' + rcnick(), 'ServerTimes': {}});
                                        return;
                                }
                                        rcaddmessagetoUI({'Text': '-!- Your nick is already ' + rcnick(), 'ServerTimes': {}});
                                        return;
                                }
-                               message = "*** " + rcnick() + " is now known as " + rest;
-                               rcsetnick(rest);
+                               if (rest) {
+                                       message = "*** " + rcnick() + " is now known as " + rest;
+                                       rcsetnick(rest);
+                               } else {
+                                       rcaddmessagetoUI({'Text': '-!- /nick requires an argument', 'ServerTimes': {}});
+                                       return;
+                               }
                        } else {
                                rcaddmessagetoUI({'Text': '-!- No such command: ' + command, 'ServerTimes': {}});
                                return;
                        } else {
                                rcaddmessagetoUI({'Text': '-!- No such command: ' + command, 'ServerTimes': {}});
                                return;