Explorar o código

Fixed potential crash when touchscreenbutton has no texture assigned

marynate %!s(int64=11) %!d(string=hai) anos
pai
achega
568be61b09
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  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);
 				}