Selaa lähdekoodia

Fix nullptr error in _update_padded_texture on texture with no image

SaracenOne 3 vuotta sitten
vanhempi
commit
257a71d29e
1 muutettua tiedostoa jossa 4 lisäystä ja 0 poistoa
  1. 4 0
      scene/resources/tile_set.cpp

+ 4 - 0
scene/resources/tile_set.cpp

@@ -4432,6 +4432,10 @@ void TileSetAtlasSource::_update_padded_texture() {
 
 	Ref<Image> src = texture->get_image();
 
+	if (!src.is_valid()) {
+		return;
+	}
+
 	Ref<Image> image;
 	image.instantiate();
 	image->create(size.x, size.y, false, src->get_format());