From dcdb5715cc10897dc7007e5d459010f38d36cc0d Mon Sep 17 00:00:00 2001 From: Relintai Date: Sun, 24 Apr 2022 11:46:46 +0200 Subject: [PATCH] Use ERR_FAIL_COND macro again if the image passed in is not valid in index_image. Also don't delete color information. --- modules/wfc/image_indexer.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/modules/wfc/image_indexer.cpp b/modules/wfc/image_indexer.cpp index 204e5b3c0..56b992e13 100644 --- a/modules/wfc/image_indexer.cpp +++ b/modules/wfc/image_indexer.cpp @@ -6,11 +6,8 @@ PoolColorArray ImageIndexer::get_colors() { } PoolIntArray ImageIndexer::index_image(Ref image) { - if(!image.is_valid()) { - return PoolIntArray(); - } + ERR_FAIL_COND_V(!image.is_valid(), PoolIntArray()); - _colors.resize(0); PoolIntArray color_indices; image->lock();