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

This commit is contained in:
flash 2024-02-24 22:03:32 +00:00
parent 0300bae994
commit 0afc5186a7
1 changed files with 5 additions and 1 deletions

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 = [];