projects
/
quix0rs-gnu-social.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bb8d377
)
Throw exception when a Conversation is not found
author
Mikael Nordfeldth
<mmn@hethane.se>
Tue, 26 May 2015 11:11:08 +0000
(13:11 +0200)
committer
Mikael Nordfeldth
<mmn@hethane.se>
Tue, 26 May 2015 11:11:08 +0000
(13:11 +0200)
classes/Conversation.php
patch
|
blob
|
history
diff --git
a/classes/Conversation.php
b/classes/Conversation.php
index 343668cc49d95e6632488c77f87668ed690aaecf..537c214a4c21991b54a20fea942a5c6a0ff2c325 100644
(file)
--- 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);
}