From 2250273942aadbdf8ec4603eb693259c359d1b79 Mon Sep 17 00:00:00 2001 From: Luke Fitzgerald Date: Wed, 4 Aug 2010 08:46:04 -0700 Subject: [PATCH] Only attempt callback if non-null --- .../phergie/Phergie/Plugin/Statusnet.php | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/plugins/Irc/extlib/phergie/Phergie/Plugin/Statusnet.php b/plugins/Irc/extlib/phergie/Phergie/Plugin/Statusnet.php index bd17971976..694fefc06b 100644 --- a/plugins/Irc/extlib/phergie/Phergie/Plugin/Statusnet.php +++ b/plugins/Irc/extlib/phergie/Phergie/Plugin/Statusnet.php @@ -84,15 +84,17 @@ class Phergie_Plugin_Statusnet extends Phergie_Plugin_Abstract { * @return void */ public function onNotice() { - $event = $this->getEvent(); - if ($event->getNick() == 'NickServ') { - $message = $event->getArgument(1); - if (preg_match($this->unregRegexp, $message, $groups)) { - $screenname = $groups[1]; - call_user_func($this->regCallback, array('screenname' => $screenname, 'registered' => false)); - } elseif (preg_match($this->regRegexp, $message, $groups)) { - $screenname = $groups[1]; - call_user_func($this->regCallback, array('screenname' => $screenname, 'registered' => true)); + if ($this->regCallback !== NULL) { + $event = $this->getEvent(); + if ($event->getNick() == 'NickServ') { + $message = $event->getArgument(1); + if (preg_match($this->unregRegexp, $message, $groups)) { + $screenname = $groups[1]; + call_user_func($this->regCallback, array('screenname' => $screenname, 'registered' => false)); + } elseif (preg_match($this->regRegexp, $message, $groups)) { + $screenname = $groups[1]; + call_user_func($this->regCallback, array('screenname' => $screenname, 'registered' => true)); + } } } } -- 2.39.5