From bde962dbddacfe5d09acb444eda66498b864b756 Mon Sep 17 00:00:00 2001 From: Chaosus Date: Wed, 25 Jul 2018 12:23:34 +0300 Subject: [PATCH] Fix crash when you pass invalid parameter to ImageTexture.set_data --- scene/resources/texture.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index 2baad555c0..5fb9f79a1e 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -235,6 +235,8 @@ Error ImageTexture::load(const String &p_path) { void ImageTexture::set_data(const Ref &p_image) { + ERR_FAIL_COND(p_image.is_null()); + VisualServer::get_singleton()->texture_set_data(texture, p_image); _change_notify();