From 54f228fb6f81e0c2ac7961266addc4744cef36e8 Mon Sep 17 00:00:00 2001 From: ZhaiSoul <842607283@qq.com> Date: Wed, 5 Nov 2025 13:56:51 +0000 Subject: [PATCH] fix: fix the logical error in the null/empty check for the polygons parameter --- web/src/components/settings/PolygonCanvas.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/components/settings/PolygonCanvas.tsx b/web/src/components/settings/PolygonCanvas.tsx index 3ba059d78..e2809d332 100644 --- a/web/src/components/settings/PolygonCanvas.tsx +++ b/web/src/components/settings/PolygonCanvas.tsx @@ -262,7 +262,7 @@ export function PolygonCanvas({ }; useEffect(() => { - if (activePolygonIndex === undefined || !polygons) { + if (activePolygonIndex === undefined || !polygons?.length) { return; } @@ -270,7 +270,7 @@ export function PolygonCanvas({ const activePolygon = updatedPolygons[activePolygonIndex]; // add default points order for already completed polygons - if (!activePolygon?.pointsOrder && activePolygon?.isFinished) { + if (!activePolygon.pointsOrder && activePolygon.isFinished) { updatedPolygons[activePolygonIndex] = { ...activePolygon, pointsOrder: activePolygon.points.map((_, index) => index),