diff options
author | Max Hilbrunner <mhilbrunner@users.noreply.github.com> | 2018-07-25 12:00:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-25 12:00:49 +0200 |
commit | 46985ae0755871493003352acd7bae9b6e35c621 (patch) | |
tree | e6cc1c3f052c3c68a87d57fc02e5ad0ad5184b4e | |
parent | f778bd8e694cb9c93cc0e021418f2be362dcdd3c (diff) | |
parent | bde962dbddacfe5d09acb444eda66498b864b756 (diff) |
Merge pull request #20440 from Chaosus/fixtexturecrash
Fix game crash when you pass invalid or null parameter to ImageTexture.set_data
-rw-r--r-- | scene/resources/texture.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
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<Image> &p_image) { + ERR_FAIL_COND(p_image.is_null()); + VisualServer::get_singleton()->texture_set_data(texture, p_image); _change_notify(); |