diff --git a/app/assets/javascripts/discourse/app/widgets/post.js b/app/assets/javascripts/discourse/app/widgets/post.js index a6f58ae04e7..e4354c844a7 100644 --- a/app/assets/javascripts/discourse/app/widgets/post.js +++ b/app/assets/javascripts/discourse/app/widgets/post.js @@ -436,8 +436,11 @@ createWidget("post-contents", { if (this.siteSettings.enable_filtered_replies_view) { const topicController = this.register.lookup("controller:topic"); - defaultState.filteredRepliesShown = - topicController.replies_to_post_number === attrs.post_number.toString(); + if (attrs.post_number) { + defaultState.filteredRepliesShown = + topicController.replies_to_post_number === + attrs.post_number.toString(); + } } return defaultState;