A platform for community discussion. Free, open, simple.
FIX: 'topic' can have null value
Vinoth Kannan1b454c73ae07
diff --git a/Gemfile.lock b/Gemfile.lockindex 299c7f91ac8..1c78e4c7209 100644--- a/Gemfile.lock+++ b/Gemfile.lock@@ -560,4 +560,4 @@ DEPENDENCIESwebpushBUNDLED WITH- 1.17.3+ 2.0.1diff --git a/app/assets/javascripts/discourse/components/topic-status.js.es6 b/app/assets/javascripts/discourse/components/topic-status.js.es6index a3e47b75975..9e92561ea6f 100644--- a/app/assets/javascripts/discourse/components/topic-status.js.es6+++ b/app/assets/javascripts/discourse/components/topic-status.js.es6@@ -32,8 +32,13 @@ export default Ember.Component.extend(buildBuffer(buffer) {const canAct = this.get("canAct");+ const topic = this.get("topic");- TopicStatusIcons.render(this.get("topic"), function(name, key) {+ if (!topic) {+ return;+ }++ TopicStatusIcons.render(topic, function(name, key) {const actionable = ["pinned", "unpinned"].includes(key) && canAct;const title = escapeExpression(I18n.t(`topic_statuses.${key}.help`)),startTag = actionable ? "a href" : "span",