From: dms Date: Sat, 7 Apr 2001 12:06:43 +0000 (+0000) Subject: - we now check if CODEREF exists. X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=55f3301ffc29179747f2651ba2cdb5cff8fb5fb5;p=infobot.git - we now check if CODEREF exists. git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@432 c11ca15a-4712-0410-83d8-924469b57eb5 --- diff --git a/src/CommandStubs.pl b/src/CommandStubs.pl index 4a052a8..a4c3679 100644 --- a/src/CommandStubs.pl +++ b/src/CommandStubs.pl @@ -111,7 +111,11 @@ sub parseCmdHook { &loadMyModule($myModules{ $hash{'Module'} }); } - ### TODO: check if CODEREF exists. + # check if CODEREF exists. + if (!defined &{ $hash{'CODEREF'} }) { + &WARN("coderef $hash{'CODEREF'} don't exist."); + return 1; + } if (exists $hash{'ArrayArgs'}) { &{$hash{'CODEREF'}}(@args);