Browse Source

Fixed potential crash when touchscreenbutton has no texture assigned

marynate 11 years ago
parent
commit
568be61b09
1 changed files with 2 additions and 1 deletions
  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 {
 				} else {
 
 
-					touched=Rect2(Point2(),texture->get_size()).has_point(coord);
+					if (texture.is_valid())
+						touched=Rect2(Point2(),texture->get_size()).has_point(coord);
 				}
 				}