Parcourir la source

fix: bug where disableIcons would throw error if there was no icon on screen

lairaalmas il y a 1 an
Parent
commit
81bb1fdb6a
1 fichiers modifiés avec 4 ajouts et 2 suppressions
  1. 4 2
      js/globals/globals_functions.js

+ 4 - 2
js/globals/globals_functions.js

@@ -66,8 +66,10 @@ const navigation = {
   },
 
   disableIcon: (icon) => {
-    icon.alpha = 0;
-    icon.isDisabled = true;
+    if (icon) {
+      icon.alpha = 0;
+      icon.isDisabled = true;
+    }
   },
 
   onInputDown: (x, y) => {