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 73ffd22fe6
commit af100649d2

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