From 3ef1d76a41d049bf05099e09400bfd0c4e5d1612 Mon Sep 17 00:00:00 2001 From: dms Date: Sat, 7 Apr 2001 12:06:43 +0000 Subject: [PATCH] - we now check if CODEREF exists. git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@432 c11ca15a-4712-0410-83d8-924469b57eb5 --- blootbot/src/CommandStubs.pl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); -- 2.39.5