浏览代码

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);
 				}