Skip to content

Commit 4a2c1f8

Browse files
olapawlusNicholasPeretti
authored andcommitted
[Maps] Fix TS error in ESGeoGridSource by adding array check for compositeSplit buckets (elastic#244740)
Resolves partially elastic#187897
1 parent 2aaf4b7 commit 4a2c1f8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

x-pack/platform/plugins/shared/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,8 @@ export class ESGeoGridSource extends AbstractESAggSource implements IMvtVectorSo
383383

384384
const aggr = esResponse.aggregations?.compositeSplit as AggregationsCompositeAggregate;
385385
afterKey = aggr.after_key;
386-
// @ts-expect-error upgrade typescript v5.1.6
387-
if (aggr.buckets.length < gridsPerRequest) {
386+
387+
if (Array.isArray(aggr.buckets) && aggr.buckets.length < gridsPerRequest) {
388388
// Finished because request did not get full resultset back
389389
break;
390390
}

0 commit comments

Comments
 (0)