]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
check to see the reply_for worked
authorEvan Prodromou <evan@prodromou.name>
Mon, 7 Jul 2008 06:26:18 +0000 (02:26 -0400)
committerEvan Prodromou <evan@prodromou.name>
Mon, 7 Jul 2008 06:26:18 +0000 (02:26 -0400)
darcs-hash:20080707062618-84dde-2bf8d7476a7b234d0f3bc88ce0a20024654c6625.gz

lib/util.php

index 6c5f4cd7affbadbad681fd4edf5c01eb1c2d1c6f..7b59a7452f4fe91194addec2de1e791530e4d494 100644 (file)
@@ -845,8 +845,10 @@ function common_save_replies($notice) {
                $reply->notice_id = $notice->id;
                $reply->profile_id = $recipient->id;
                $reply->created = DB_DataObject_Cast::dateTime();
-               $recipient_notice = $reply_for->getCurrentNotice($notice->created);
-               $reply->replied_id = $recipient_notice->id;
+               if ($reply_for) {
+                       $recipient_notice = $reply_for->getCurrentNotice($notice->created);
+                       $reply->replied_id = $recipient_notice->id;
+               }
                $id = $reply->insert();
                if (!$id) {
                        common_log_db_error($reply, 'INSERT', __FILE__);