DEV: Fix flaky Ember test (#12802)

DEV: Fix flaky Ember test (#12802)

diff --git a/app/assets/javascripts/discourse/app/components/d-editor.js b/app/assets/javascripts/discourse/app/components/d-editor.js
index 857a20f..643934d 100644
--- a/app/assets/javascripts/discourse/app/components/d-editor.js
+++ b/app/assets/javascripts/discourse/app/components/d-editor.js
@@ -613,7 +613,7 @@ export default Component.extend({
   },
 
   _getSelected(trimLeading, opts) {
-    if (!this.ready) {
+    if (!this.ready || !this.element) {
       return;
     }
 

GitHub sha: fd6f0db7