DEV: ensures container is not destroyed before showing tooltip (#13992)

DEV: ensures container is not destroyed before showing tooltip (#13992)

In fast tests it could results in an error.

diff --git a/plugins/discourse-local-dates/assets/javascripts/initializers/discourse-local-dates.js.es6 b/plugins/discourse-local-dates/assets/javascripts/initializers/discourse-local-dates.js.es6
index 108fae4..68b94e7 100644
--- a/plugins/discourse-local-dates/assets/javascripts/initializers/discourse-local-dates.js.es6
+++ b/plugins/discourse-local-dates/assets/javascripts/initializers/discourse-local-dates.js.es6
@@ -130,8 +130,12 @@ export default {
   name: "discourse-local-dates",
 
   showDatePopover(event) {
-    const siteSettings = getOwner(this).lookup("site-settings:main");
+    const owner = getOwner(this);
+    if (owner.isDestroyed || owner.isDestroying) {
+      return;
+    }
 
+    const siteSettings = owner.lookup("site-settings:main");
     if (event?.target?.classList?.contains("discourse-local-date")) {
       showPopover(event, {
         htmlContent: buildHtmlPreview(event.target, siteSettings),

GitHub sha: 4ca34940d3bace1cd5d4193da0171ac326e64a5a

This commit appears in #13992 which was approved by CvX. It was merged by jjaffeux.