diff --git a/src/Http/Handlers/NewsHandler.php b/src/Http/Handlers/NewsHandler.php index c0d19a0..5f492ea 100644 --- a/src/Http/Handlers/NewsHandler.php +++ b/src/Http/Handlers/NewsHandler.php @@ -126,9 +126,12 @@ final class NewsHandler extends Handler { $comments = $this->context->getComments(); - if($postInfo->hasCommentsCategoryId()) { - $commentsCategory = $comments->getCategoryById($postInfo->getCommentsCategoryId()); - } else { + if($postInfo->hasCommentsCategoryId()) + try { + $commentsCategory = $comments->getCategoryById($postInfo->getCommentsCategoryId()); + } catch(RuntimeException $ex) {} + + if(!isset($commentsCategory)) { $commentsCategory = $comments->ensureCategory($postInfo->getCommentsCategoryName()); $news->updatePostCommentCategory($postInfo, $commentsCategory); }