From 568be61b0985d4abb1b6ca7ffcec7f79447d3514 Mon Sep 17 00:00:00 2001 From: marynate Date: Sun, 13 Jul 2014 10:08:50 +0800 Subject: [PATCH] Fixed potential crash when touchscreenbutton has no texture assigned --- scene/2d/screen_button.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scene/2d/screen_button.cpp b/scene/2d/screen_button.cpp index 6d843b87cd6..848f5afeb94 100644 --- a/scene/2d/screen_button.cpp +++ b/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); }