From 9501f57469c635d68636b9866c69234404f32d4d Mon Sep 17 00:00:00 2001 From: Richard Zink Date: Tue, 6 Oct 2026 16:23:50 +0200 Subject: [PATCH] Fix undefined check --- assets/index.html | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/assets/index.html b/assets/index.html index 6ac888a..f756d47 100644 --- a/assets/index.html +++ b/assets/index.html @@ -231,6 +231,7 @@ }); transformedVerts.forEach(v => { + if (!v) return; const proj = v.project(); if (!proj) return; ctx.beginPath(); @@ -240,8 +241,11 @@ }); for (let i = 0; i < transformedVerts.length - 1; i++) { - const p1 = transformedVerts[i].project(); - const p2 = transformedVerts[i + 1].project(); + const v1 = transformedVerts[i]; + const v2 = transformedVerts[i + 1]; + if (!v1 || !v2) continue; + const p1 = v1.project(); + const p2 = v2.project(); if (!p1 || !p2) continue; ctx.beginPath(); ctx.moveTo(p1.x, p1.y);