diff --git a/post.php b/post.php index 31a74b5e..93b63068 100644 --- a/post.php +++ b/post.php @@ -351,6 +351,8 @@ function handle_report(){ $query->execute() or error(db_error($query)); $thread = $query->fetch(PDO::FETCH_ASSOC); + // check if post was deleted before the report arrived + if ($thread === false) continue; $error = event('report', array('ip' => $_SERVER['REMOTE_ADDR'], 'board' => $board['uri'], 'post' => $post, 'reason' => $reason, 'link' => link_for($thread))); if ($error) {