From: Luke Fitzgerald Date: Wed, 4 Aug 2010 15:46:04 +0000 (-0700) Subject: Only attempt callback if non-null X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2250273942aadbdf8ec4603eb693259c359d1b79;p=quix0rs-gnu-social.git Only attempt callback if non-null --- 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)); + } } } }