From 8de5b78a97b7938399d29c17840bedcd937e9a08 Mon Sep 17 00:00:00 2001 From: Sean Kim Date: Wed, 20 Oct 2021 22:55:08 -0700 Subject: [PATCH] Fix crash on null image ref in ProceduralSky --- scene/resources/sky.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scene/resources/sky.cpp b/scene/resources/sky.cpp index cae5e54e050..75b8b0e1f58 100644 --- a/scene/resources/sky.cpp +++ b/scene/resources/sky.cpp @@ -390,6 +390,8 @@ void ProceduralSky::_queue_update() { } void ProceduralSky::_thread_done(const Ref &p_image) { + ERR_FAIL_COND(p_image.is_null()); + panorama = p_image; VS::get_singleton()->texture_allocate(texture, panorama->get_width(), panorama->get_height(), 0, Image::FORMAT_RGBE9995, VS::TEXTURE_TYPE_2D, VS::TEXTURE_FLAG_FILTER | VS::TEXTURE_FLAG_REPEAT); VS::get_singleton()->texture_set_data(texture, panorama);