소스 검색

Fixed potential crash when touchscreenbutton has no texture assigned

marynate 11 년 전
부모
커밋
568be61b09
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      scene/2d/screen_button.cpp

+ 2 - 1
scene/2d/screen_button.cpp

@@ -170,7 +170,8 @@ void TouchScreenButton::_input(const InputEvent& p_event) {
 					}
 				} else {
 
-					touched=Rect2(Point2(),texture->get_size()).has_point(coord);
+					if (texture.is_valid())
+						touched=Rect2(Point2(),texture->get_size()).has_point(coord);
 				}