]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Xmpp/XmppPlugin.php
Fix typo on 986030060b84
[quix0rs-gnu-social.git] / plugins / Xmpp / XmppPlugin.php
index f8476cd8f2b2fadc7864bcf3760fd83debc6840f..da205043298ab081f788a1f984ae3bef15da4bae 100644 (file)
@@ -315,9 +315,13 @@ class XmppPlugin extends ImPlugin
 
     function sendNotice($screenname, Notice $notice)
     {
-        $msg   = $this->formatNotice($notice);
-        $entry = $this->format_entry($notice);
-
+        try {
+            $msg   = $this->formatNotice($notice);
+            $entry = $this->format_entry($notice);
+        } catch (Exception $e) {
+            common_log(LOG_ERR, __METHOD__ . ": Discarding outgoing stanza because of exception: {$e->getMessage()}");
+            return false;   // return value of sendNotice is never actually used as of now
+        }
         $this->queuedConnection()->message($screenname, $msg, 'chat', null, $entry);
         return true;
     }