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=3ef1d76a41d049bf05099e09400bfd0c4e5d1612;p=infobot.git - we now check if CODEREF exists. git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@432 c11ca15a-4712-0410-83d8-924469b57eb5 --- diff --git a/blootbot/src/CommandStubs.pl b/blootbot/src/CommandStubs.pl index 4a052a8..a4c3679 100644 --- a/blootbot/src/CommandStubs.pl +++ b/blootbot/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);