Ver Fonte

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

lairaalmas há 1 ano atrás
pai
commit
81bb1fdb6a
1 ficheiros alterados com 4 adições e 2 exclusões
  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) => {