diff --git a/src/svg/SVGImport.js b/src/svg/SVGImport.js index cf1f4d31..c83784ff 100644 --- a/src/svg/SVGImport.js +++ b/src/svg/SVGImport.js @@ -133,7 +133,7 @@ new function() { param = { pathData: data }; // If there are multiple moveTo commands or a closePath command followed // by other commands, we have a CompoundPath: - return data.match(/m/gi).length > 1 || /z\S+/i.test(data) + return (data.match(/m/gi) || []).length > 1 || /z\S+/i.test(data) ? new CompoundPath(param) : new Path(param); }