]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
make sure to show repeats correctly when original is deleted
authorEvan Prodromou <evan@status.net>
Sat, 12 Dec 2009 21:33:38 +0000 (16:33 -0500)
committerEvan Prodromou <evan@status.net>
Sat, 12 Dec 2009 21:33:38 +0000 (16:33 -0500)
lib/noticelist.php

index 7319a62ea76f7961b07f428256f8a222c7f90d6e..aa6ea278c98e4a828a6590c7e9bdcd04deb8a2b3 100644 (file)
@@ -167,8 +167,13 @@ class NoticeListItem extends Widget
     {
         parent::__construct($out);
         if (!empty($notice->repeat_of)) {
-            $this->notice = Notice::staticGet('id', $notice->repeat_of);
-            $this->repeat = $notice;
+            $original = Notice::staticGet('id', $notice->repeat_of);
+            if (empty($original)) { // could have been deleted
+                $this->notice = $notice;
+            } else {
+                $this->notice = $original;
+                $this->repeat = $notice;
+            }
         } else {
             $this->notice  = $notice;
         }