瀏覽代碼

Merge pull request #432 from marynate/PR-fix-screen-button-null-texture

Fix potential null exception in screen button without texture assigned
reduz 11 年之前
父節點
當前提交
ad61dfed5d
共有 1 個文件被更改,包括 2 次插入2 次删除
  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);
 				}