Fix undefined check
This commit is contained in:
1 parent
1d8875cd06
commit
9501f57469
1 file changed
+6
-2
+6
-2
@@ -231,6 +231,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
transformedVerts.forEach(v => {
|
transformedVerts.forEach(v => {
|
||||||
|
if (!v) return;
|
||||||
const proj = v.project();
|
const proj = v.project();
|
||||||
if (!proj) return;
|
if (!proj) return;
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
@@ -240,8 +241,11 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
for (let i = 0; i < transformedVerts.length - 1; i++) {
|
for (let i = 0; i < transformedVerts.length - 1; i++) {
|
||||||
const p1 = transformedVerts[i].project();
|
const v1 = transformedVerts[i];
|
||||||
const p2 = transformedVerts[i + 1].project();
|
const v2 = transformedVerts[i + 1];
|
||||||
|
if (!v1 || !v2) continue;
|
||||||
|
const p1 = v1.project();
|
||||||
|
const p2 = v2.project();
|
||||||
if (!p1 || !p2) continue;
|
if (!p1 || !p2) continue;
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
ctx.moveTo(p1.x, p1.y);
|
ctx.moveTo(p1.x, p1.y);
|
||||||
|
|||||||
Reference in new issue
Block a user