Browse Source

Fix potential null exception in screen button without texture assigned

marynate 11 years ago
parent
commit
fd13b25d6e
1 changed files with 2 additions and 2 deletions
  1. 2 2
      scene/2d/screen_button.cpp

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

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