diff --git a/controller/action/ContentActions.class.php b/controller/action/ContentActions.class.php index 19f5de99..07b216c1 100644 --- a/controller/action/ContentActions.class.php +++ b/controller/action/ContentActions.class.php @@ -85,8 +85,11 @@ class ContentActions extends Actions public static function executeNewsPost($relativeUri) { - $post = Post::load(ltrim($relativeUri, '/')); - if (!$post) + try + { + $post = Post::load(ltrim($relativeUri, '/')); + } + catch (PostNotFoundException $e) { return ['page/404', []]; } diff --git a/model/Post.class.php b/model/Post.class.php index 1988104a..d2bd4da2 100644 --- a/model/Post.class.php +++ b/model/Post.class.php @@ -1,5 +1,7 @@