From 33f3129f390fb0763d39831e5ddf0b44d7e19bb4 Mon Sep 17 00:00:00 2001 From: mohamedsalem401 Date: Mon, 6 Jan 2025 15:01:11 +0200 Subject: [PATCH] Fix zero end_index issue --- .../model/collection_component/CollectionComponent.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/data_sources/model/collection_component/CollectionComponent.ts b/packages/core/src/data_sources/model/collection_component/CollectionComponent.ts index 27cac8822..8a22a4096 100644 --- a/packages/core/src/data_sources/model/collection_component/CollectionComponent.ts +++ b/packages/core/src/data_sources/model/collection_component/CollectionComponent.ts @@ -111,7 +111,7 @@ function getCollectionItems( let items: any[] = getDataSourceItems(config.dataSource, em); const start_index = Math.max(0, config.start_index || 0); - const end_index = Math.min(items.length - 1, config.end_index || Number.MAX_VALUE); + const end_index = Math.min(items.length - 1, config.end_index !== undefined ? config.end_index : Number.MAX_VALUE); const total_items = end_index - start_index + 1; let blockComponent: Component;