summaryrefslogtreecommitdiff
path: root/lib/util.php
diff options
context:
space:
mode:
authorMike Cochrane <mikec@mikenz.geek.nz>2008-07-22 04:27:24 -0400
committerMike Cochrane <mikec@mikenz.geek.nz>2008-07-22 04:27:24 -0400
commit334b840c3edba51745d419c4f0c41b42dd411b80 (patch)
treea4f83b2b12245c71d3ec89278bb7c2de48961853 /lib/util.php
parentbdfe3ca524d3186532ea9433f70ab83c665e3f80 (diff)
Only Set reply details if there is something to reply to
darcs-hash:20080722082724-533db-ead12f037aa716dc548d6a4b04493ada5049ec96.gz
Diffstat (limited to 'lib/util.php')
-rw-r--r--lib/util.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/util.php b/lib/util.php
index 65eefa5d8..ea3ef3b21 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -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;