diff --git a/commands/drawDesign.cjs b/commands/drawDesign.cjs index 0bf4e0e..f9244a2 100644 --- a/commands/drawDesign.cjs +++ b/commands/drawDesign.cjs @@ -217,8 +217,9 @@ function charIterate(input) { let temp = input.split(''); for (let i = 0; i < stringLength; ++i) { let compareString = temp.join(""); - console.log(surrogatePairs.exec(compareString)); - if (surrogatePairs.exec(compareString).index == i) { + console.log(surrogatePairs.exec(compareString), compareString); + let eval = surrogatePairs.exec(compareString).index; + if (eval != null && eval == i) { stringLength--; console.log("Decreasing stringLength variable to", stringLength); }