瀏覽代碼

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

lairaalmas 1 年之前
父節點
當前提交
81bb1fdb6a
共有 1 個文件被更改,包括 4 次插入2 次删除
  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) => {