Skip to content

Commit 16a723e

Browse files
committed
Fix fatal error when loading non-existent news
1 parent 6bd2971 commit 16a723e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

controllers/News/View.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ protected function getNewsPost(NewsViewModel &$model) {
6565
}
6666

6767
// Don't show unpublished news posts to non-staff
68-
if (!($model->news_post->getOptionsBitmask() & NewsPost::OPTION_PUBLISHED)
68+
if ($model->news_post
69+
&& !($model->news_post->getOptionsBitmask() & NewsPost::OPTION_PUBLISHED)
6970
&& !$model->acl_allowed) $model->news_post = null;
7071
}
7172

0 commit comments

Comments
 (0)