diff --git a/src/market/api/api.ts b/src/market/api/api.ts index ded5792e29..389f2913cf 100644 --- a/src/market/api/api.ts +++ b/src/market/api/api.ts @@ -52,6 +52,8 @@ const matchSearch = }; function distributedCopy(items: number[], n: number): number[] { + if (!items) return []; + if (items.length <= n) return items; const elements = [items[0]]; const totalItems = items.length - 2; const interval = Math.floor(totalItems / (n - 2));