diff --git a/app/assets/javascripts/discourse/app/controllers/topic.js b/app/assets/javascripts/discourse/app/controllers/topic.js index 1be8e37ef74..49467d5a30e 100644 --- a/app/assets/javascripts/discourse/app/controllers/topic.js +++ b/app/assets/javascripts/discourse/app/controllers/topic.js @@ -189,17 +189,19 @@ export default Controller.extend(bufferedProperty("model"), { }, _removeDeleteOnOwnerReplyBookmarks() { - let posts = this.model.get("postStream").posts; - posts - .filter( - p => - p.bookmarked && - p.bookmark_auto_delete_preference === - AUTO_DELETE_PREFERENCES.ON_OWNER_REPLY - ) - .forEach(p => { - p.clearBookmark(); - }); + const posts = this.get("model.postStream.posts"); + if (posts) { + posts + .filter( + p => + p.bookmarked && + p.bookmark_auto_delete_preference === + AUTO_DELETE_PREFERENCES.ON_OWNER_REPLY + ) + .forEach(p => { + p.clearBookmark(); + }); + } }, _forceRefreshPostStream() {