Skip to content

Commit 153d300

Browse files
committed
defensive check as per pr2070
1 parent bc28599 commit 153d300

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/typography/p5.Font.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,10 @@ function pointAtLength(path, length, istotal) {
623623
function pathToAbsolute(pathArray) {
624624

625625
var res = [], x = 0, y = 0, mx = 0, my = 0, start = 0;
626+
if (!pathArray) {
627+
// console.warn("Unexpected state: undefined pathArray"); // shouldn't happen
628+
return res;
629+
}
626630
if (pathArray[0][0] === 'M') {
627631
x = +pathArray[0][1];
628632
y = +pathArray[0][2];

0 commit comments

Comments
 (0)