diff --git a/parser/pathParser.js b/parser/pathParser.js index 738328e..3f44586 100644 --- a/parser/pathParser.js +++ b/parser/pathParser.js @@ -3,6 +3,9 @@ const pathParser = function (layer) { return null; } let path = layer.path; + if(!path.points || !path.points.length) { + return null; + } let {x, y} = getXY(path.points[0].point,layer); let ret = `M${toS(x)},${toS(y)}`; let n = path['isClosed'] ? path.points.length + 1 : path.points.length; @@ -41,4 +44,4 @@ function getXY(s,layer) { y = layer.frame.height * y; return {x, y} } -module.exports = pathParser; \ No newline at end of file +module.exports = pathParser;