summaryrefslogtreecommitdiff
path: root/scene/2d
diff options
context:
space:
mode:
authormarynate <mary.w.nate@gmail.com>2014-07-13 10:08:50 +0800
committermarynate <mary.w.nate@gmail.com>2014-07-13 10:09:47 +0800
commit568be61b0985d4abb1b6ca7ffcec7f79447d3514 (patch)
treefc8818d00d9e0837168b1516ee6e453ecca01418 /scene/2d
parentb1e03d536f0f2cceb470b9f768b6841b4ea94251 (diff)
Fixed potential crash when touchscreenbutton has no texture assigned
Diffstat (limited to 'scene/2d')
-rw-r--r--scene/2d/screen_button.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/scene/2d/screen_button.cpp b/scene/2d/screen_button.cpp
index 6d843b87cd..848f5afeb9 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);
}