diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-03-04 08:15:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-04 08:15:23 +0100 |
commit | 484ad8d362c7e099c30bdba9ff6bfeb79ee8a25d (patch) | |
tree | c6a3776c5a3e5cc46a2fcb6d8e41577198501b32 | |
parent | 8ff25ffb78a1f1ff37273dbd90e1b5e47fb5a4e4 (diff) | |
parent | 46218d8c37cadee78f77e8bf0da13aebeff07ab1 (diff) |
Merge pull request #46640 from pdfrod/fix-crash-in-image-texture
Fix crash trying to destroy an ImageTexture object containing a null texture
-rw-r--r-- | scene/resources/texture.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index 8cccf81659..d2bb1338d8 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -151,7 +151,7 @@ void ImageTexture::_reload_hook(const RID &p_hook) { } void ImageTexture::create_from_image(const Ref<Image> &p_image) { - ERR_FAIL_COND_MSG(p_image.is_null(), "Invalid image"); + ERR_FAIL_COND_MSG(p_image.is_null() || p_image->is_empty(), "Invalid image"); w = p_image->get_width(); h = p_image->get_height(); format = p_image->get_format(); |