]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Only Set reply details if there is something to reply to
authorMike Cochrane <mikec@mikenz.geek.nz>
Tue, 22 Jul 2008 08:27:24 +0000 (04:27 -0400)
committerMike Cochrane <mikec@mikenz.geek.nz>
Tue, 22 Jul 2008 08:27:24 +0000 (04:27 -0400)
darcs-hash:20080722082724-533db-ead12f037aa716dc548d6a4b04493ada5049ec96.gz

lib/util.php

index 65eefa5d8b81be02fcd02b6fc6a9abdea0e2df60..ea3ef3b21064b959a3fe3685f2f1fc2003f24492 100644 (file)
@@ -1009,9 +1009,11 @@ function common_save_replies($notice) {
                if ($i == 0 && ($recipient->id != $sender->id)) { # Don't save reply to self
                        $reply_for = $recipient;
                        $recipient_notice = $reply_for->getCurrentNotice();
-                       $orig = clone($notice);
-                       $notice->reply_to = $recipient_notice->id;
-                       $notice->update($orig);
+                       if ($recipient_notice) {
+                               $orig = clone($notice);
+                               $notice->reply_to = $recipient_notice->id;
+                               $notice->update($orig);
+                       }
                }
                $reply = new Reply();
                $reply->notice_id = $notice->id;