A platform for community discussion. Free, open, simple.
DEV: Don't check `this.element` in `@afterRender` (#16033)
Jarek Radosz44824bfa3de0
diff --git a/app/assets/javascripts/discourse-common/addon/utils/decorators.js b/app/assets/javascripts/discourse-common/addon/utils/decorators.jsindex 3439a4239fb..c5428229773 100644--- a/app/assets/javascripts/discourse-common/addon/utils/decorators.js+++ b/app/assets/javascripts/discourse-common/addon/utils/decorators.js@@ -20,7 +20,7 @@ export function afterRender(target, name, descriptor) {const originalFunction = descriptor.value;descriptor.value = function () {schedule("afterRender", () => {- if (this.element && !this.isDestroying && !this.isDestroyed) {+ if (!this.isDestroying && !this.isDestroyed) {return originalFunction.apply(this, arguments);}});