From 48e9447c4799c070d9f126674f646e354a3e6360 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Mon, 22 Sep 2014 17:44:15 +0200 Subject: [PATCH] Avoid error when SVG path data does not contain any 'm' commands. Fixes #529 --- src/svg/SVGImport.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); }