Skip to content

Commit 4a4bbbd

Browse files
authored
[Fix] DefaultSegmentBuilderExecutor throws error when total item count is 0 (#295)
* Fix - DefaultSegmentBuilderExecutor error when customer count is zero * Apply php-cs-fixer changes * Changed condition to empty item check * Apply php-cs-fixer changes Co-authored-by: aryaantony92 <[email protected]>
1 parent b8a54f0 commit 4a4bbbd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/SegmentManager/SegmentBuilderExecutor/DefaultSegmentBuilderExecutor.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@ public function buildCalculatedSegments(
157157
// note: listing is now constant and may be flushed per iteration
158158
$pageSize = $desiredPageSize !== null && $desiredPageSize > 0 ? $desiredPageSize : 250;
159159
$idList = $customerList->loadIdList();
160+
if (count($idList) == 0) {
161+
return;
162+
}
160163
$paginator = $this->paginator->paginate($idList, 1, $pageSize);
161164

162165
$totalAmount = $paginator->getTotalItemCount();

0 commit comments

Comments
 (0)