ソースを参照

Fix crash on null image ref in ProceduralSky

Sean Kim 3 年 前
コミット
8de5b78a97
1 ファイル変更2 行追加0 行削除
  1. 2 0
      scene/resources/sky.cpp

+ 2 - 0
scene/resources/sky.cpp

@@ -390,6 +390,8 @@ void ProceduralSky::_queue_update() {
 }
 }
 
 
 void ProceduralSky::_thread_done(const Ref<Image> &p_image) {
 void ProceduralSky::_thread_done(const Ref<Image> &p_image) {
+	ERR_FAIL_COND(p_image.is_null());
+
 	panorama = p_image;
 	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_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);
 	VS::get_singleton()->texture_set_data(texture, panorama);