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();