add check totoggleMainNav so returns if no nav

Chris Pollett [2023-01-27 02:Jan:th]
add check totoggleMainNav so returns if no nav
Filename
js/game.js
diff --git a/js/game.js b/js/game.js
index 80da551..437f7b6 100644
--- a/js/game.js
+++ b/js/game.js
@@ -305,6 +305,9 @@ function toggleMainNav()
 {
     let game_content = elt('game-content');
     let nav_obj = elt('main-nav');
+    if (nav_obj) {
+        return;
+    }
     if ((!nav_obj.style.left && !nav_obj.style.right) ||
         nav_obj.style.left == '0px' || nav_obj.style.right == '0px') {
         game_content.style.width = "calc(100% - 40px)";
ViewGit