fixed cookie funcmd: do not continue function if there was no valid user passed
authorpk910 <philipp@zoelle1.de>
Sat, 14 Jan 2012 12:07:53 +0000 (13:07 +0100)
committerpk910 <philipp@zoelle1.de>
Sat, 14 Jan 2012 12:07:53 +0000 (13:07 +0100)
src/cmd_funcmds.c

index 4cf6c9062f66a7d170820b5df5157d6a894c798c..3f4095ad6f45c4cf0410ec371dcfb4ed23e87231 100644 (file)
@@ -199,8 +199,10 @@ CMD_BIND(funcmd_8ball) {
 CMD_BIND(funcmd_cookie) {
     FUNCMD_HEADER;
     if(argc) {
-        if(!(user = getUserByNick(argv[0])))
+        if(!(user = getUserByNick(argv[0]))) {
             reply(current_funcmd.client, current_funcmd.user, "NS_USER_UNKNOWN", argv[0]);
+            return;
+        }
     }
     char *tmp;
     int user_count = ((tmp = getSetting(user, chan, "cookies")) ? atoi(tmp) : 0);