Skip to content

Commit 061f1de

Browse files
author
Tom Coward
committed
Check if post is found before checking message_state
Fixes issue #5
1 parent 5fa6c46 commit 061f1de

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

XFRM/Service/ResourceUpdate/Delete.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ protected function deleteDiscussionThreadPost($update)
2525
['message', 'LIKE', $updateUrl]
2626
])->fetchOne();
2727

28-
// Delete resource update's post if was unapproved
29-
if($post->message_state == 'moderated'){
28+
// Delete resource update's post if unapproved
29+
if($post AND $post->message_state == 'moderated'){
3030
/** @var \XF\Service\Post\Deleter $postDeleter */
3131
$postDeleter = $this->service('XF:Post\Deleter', $post);
3232
$postDeleter->delete('soft', \XF::phrase('xfrm_resource_update').' deleted');

_output/phrases/_metadata.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[]

0 commit comments

Comments
 (0)