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

View file

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