Use ERR_FAIL_COND macro again if the image passed in is not valid in index_image. Also don't delete color information.

This commit is contained in:
Relintai 2022-04-24 11:46:46 +02:00
parent 53aed73a64
commit dcdb5715cc

View File

@ -6,11 +6,8 @@ PoolColorArray ImageIndexer::get_colors() {
}
PoolIntArray ImageIndexer::index_image(Ref<Image> image) {
if(!image.is_valid()) {
return PoolIntArray();
}
ERR_FAIL_COND_V(!image.is_valid(), PoolIntArray());
_colors.resize(0);
PoolIntArray color_indices;
image->lock();