From d2dc86b1772c729f5e9dbede0d5e3e2f167ddb1d Mon Sep 17 00:00:00 2001 From: acdunham <129009580+acdunham@users.noreply.github.com> Date: Tue, 16 Jan 2024 10:33:09 +1300 Subject: [PATCH] Handle no data when sorting --- .../tupaia-web/src/features/Map/utils/processMeasureData.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/tupaia-web/src/features/Map/utils/processMeasureData.ts b/packages/tupaia-web/src/features/Map/utils/processMeasureData.ts index 0a11d311b7..266194b5c0 100644 --- a/packages/tupaia-web/src/features/Map/utils/processMeasureData.ts +++ b/packages/tupaia-web/src/features/Map/utils/processMeasureData.ts @@ -56,7 +56,7 @@ export const processMeasureData = ({ // for radius overlay sort desc radius to place smaller circles over larger circles if (serieses.some(l => l.type === MEASURE_TYPE_RADIUS)) { - entityMeasureData.sort((a, b) => Number(b.radius) - Number(a.radius)); + entityMeasureData?.sort((a, b) => Number(b.radius) - Number(a.radius)); } return entityMeasureData;