From: Mikael Nordfeldth Date: Tue, 26 May 2015 11:11:08 +0000 (+0200) Subject: Throw exception when a Conversation is not found X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=925aacec1a09ade8acaaca2c604e33d17292fe40;p=quix0rs-gnu-social.git Throw exception when a Conversation is not found --- diff --git a/classes/Conversation.php b/classes/Conversation.php index 343668cc49..537c214a4c 100644 --- a/classes/Conversation.php +++ b/classes/Conversation.php @@ -108,7 +108,13 @@ class Conversation extends Managed_DataObject static public function getUrlFromNotice(Notice $notice, $anchor=true) { - $conv = self::getKV('id', $notice->conversation); + $conv = new Conversation(); + $conv->id = $notice->conversation; + $conv->find(true); + if (!$conv instanceof Conversation) { + common_debug('Conversation does not exist for notice ID: '.$notice->id); + throw new NoResultException($conv); + } return $conv->getUrl($anchor ? $notice->id : null); }