소스 검색

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) => {