FIX: ensures container has not been destroyed

FIX: ensures container has not been destroyed

diff --git a/assets/javascripts/discourse/initializers/discourse-voting.js.es6 b/assets/javascripts/discourse/initializers/discourse-voting.js.es6
index c08fad5..ea6141b 100644
--- a/assets/javascripts/discourse/initializers/discourse-voting.js.es6
+++ b/assets/javascripts/discourse/initializers/discourse-voting.js.es6
@@ -8,8 +8,17 @@ export default {
       api.addNavigationBarItem({
         name: "votes",
         customFilter: category => {
-          const siteSettings = api.container.lookup("site-settings:main");
-          return siteSettings.voting_enabled && category && category.can_vote;
+          const container = api.container;
+
+          if (
+            container &&
+            (!container.isDestroying || !container.isDestroyed)
+          ) {
+            const siteSettings = container.lookup("site-settings:main");
+            return siteSettings.voting_enabled && category && category.can_vote;
+          }
+
+          return false;
         },
         customHref: (category, args) => {
           return `${Discourse.BaseUri}/${args.filterMode}?order=votes`;

GitHub sha: 4f385c50