From 21eac24af1b119f1e29e33b53bdb88a400de16c3 Mon Sep 17 00:00:00 2001 From: sersoong Date: Fri, 27 Apr 2018 17:22:42 +0800 Subject: [PATCH] Fixed stylebox crash --- scene/resources/style_box.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scene/resources/style_box.cpp b/scene/resources/style_box.cpp index 626fda50df9..ad5a0fd9ab5 100644 --- a/scene/resources/style_box.cpp +++ b/scene/resources/style_box.cpp @@ -106,7 +106,11 @@ void StyleBoxTexture::set_texture(Ref 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");