Fixed error when trying to access a topic with no posts associated.

This commit is contained in:
Pachira 2024-02-24 22:03:32 +00:00
parent 0300bae994
commit 0afc5186a7

View file

@ -291,7 +291,11 @@ $postInfos = $forumPosts->getPosts(
if(empty($postInfos))
Template::throwError(404);
$originalPostInfo = $forumPosts->getPost(topicInfo: $topicInfo);
try {
$originalPostInfo = $forumPosts->getPost(topicInfo: $topicInfo);
} catch(RuntimeException $ex) {
Template::throwError(404);
}
$posts = [];