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 => {
|
||||
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);
|
||||
|
||||
Reference in new issue
Block a user