From fd13b25d6e1256d3ca04e604441f3a05bb25572b Mon Sep 17 00:00:00 2001 From: marynate Date: Tue, 20 May 2014 21:05:18 +0800 Subject: [PATCH] Fix potential null exception in screen button without texture assigned --- scene/2d/screen_button.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scene/2d/screen_button.cpp b/scene/2d/screen_button.cpp index 32a5323419..9d0c9f3d1a 100644 --- a/scene/2d/screen_button.cpp +++ b/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); }