Skip to content

A platform for community discussion. Free, open, simple.

FIX: prevents exception when the node doesnt exist anymore (#7408)

Joffrey JAFFEUX151da50e7c21
diff --git a/app/assets/javascripts/discourse/components/text-overflow.js.es6 b/app/assets/javascripts/discourse/components/text-overflow.js.es6
index 905ae32a5af..402b3a9cf12 100644
--- a/app/assets/javascripts/discourse/components/text-overflow.js.es6
+++ b/app/assets/javascripts/discourse/components/text-overflow.js.es6
@@ -2,10 +2,12 @@ export default Ember.Component.extend({
didInsertElement() {
this._super(...arguments);
Ember.run.next(null, () => {
- this.$()
- .find("hr")
- .remove();
- this.$().ellipsis();
+ const $this = this.$();
+
+ if ($this) {
+ $this.find("hr").remove();
+ $this.ellipsis();
+ }
});
}
});