summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGilles Roudière <gilles.roudiere@gmail.com>2018-04-27 15:26:42 +0200
committerGitHub <noreply@github.com>2018-04-27 15:26:42 +0200
commitdeee9f0cb47e00645cf56340e34c78b21170977a (patch)
treef27e9015c0f85b94439f2ecd75bdbb6f71c2d715
parentb35f3a569e578c5ff7eb73257f84d74e30e361d1 (diff)
parent21eac24af1b119f1e29e33b53bdb88a400de16c3 (diff)
Merge pull request #18464 from sersoong/master-fixstylebox
Fix stylebox crash
-rw-r--r--scene/resources/style_box.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/scene/resources/style_box.cpp b/scene/resources/style_box.cpp
index 626fda50df..ad5a0fd9ab 100644
--- a/scene/resources/style_box.cpp
+++ b/scene/resources/style_box.cpp
@@ -106,7 +106,11 @@ void StyleBoxTexture::set_texture(Ref<Texture> p_texture) {
if (texture == p_texture)
return;
texture = p_texture;
- region_rect = Rect2(Point2(), texture->get_size());
+ if (p_texture.is_null()) {
+ region_rect = Rect2(0, 0, 0, 0);
+ } else {
+ region_rect = Rect2(Point2(), texture->get_size());
+ }
emit_signal("texture_changed");
emit_changed();
_change_notify("texture");