From 0afc5186a709216d01d9a4549eaeadf71736b82a Mon Sep 17 00:00:00 2001 From: flashwave Date: Sat, 24 Feb 2024 22:03:32 +0000 Subject: [PATCH] Fixed error when trying to access a topic with no posts associated. --- public-legacy/forum/topic.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public-legacy/forum/topic.php b/public-legacy/forum/topic.php index b722fc2..ad204fd 100644 --- a/public-legacy/forum/topic.php +++ b/public-legacy/forum/topic.php @@ -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 = [];