diff --git a/QvitterPlugin.php b/QvitterPlugin.php index daaab26..750f293 100644 --- a/QvitterPlugin.php +++ b/QvitterPlugin.php @@ -698,13 +698,17 @@ class QvitterPlugin extends Plugin { $reply_notification_to = false; // check for reply to insert in notifications if($notice->reply_to) { - $replyparent = $notice->getParent(); - $replyauthor = $replyparent->getProfile(); - if ($replyauthor instanceof Profile) { + try { + $replyauthor = $notice->getParent()->getProfile(); $reply_notification_to = $replyauthor->id; $this->insertNotification($replyauthor->id, $notice->profile_id, 'reply', $notice->id); - } + //} catch (NoParentNoticeException $e) { // TODO: catch this when everyone runs latest GNU social! + // This is not a reply to something (has no parent) + } catch (NoResultException $e) { + // Parent notice or its author's profile not found! Complain louder? + common_log(LOG_ERR, 'NoResultException: '.$e->getMessage()); } + } // check for mentions to insert in notifications $mentions = common_find_mentions($notice->content, $notice);