Skip to content

Commit

Permalink
Fix error due to invalid transform. Close svg#846
Browse files Browse the repository at this point in the history
  • Loading branch information
GreLI committed Nov 22, 2017
1 parent b182569 commit 1a3c32b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 3 additions & 5 deletions plugins/_transforms.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ exports.transform2js = function(transformString) {
}
});

return transforms;

// return empty array if broken transform (no data)
return current && current.data ? transforms : [];
};

/**
Expand All @@ -65,9 +65,7 @@ exports.transformsMultiply = function(transforms) {
// multiply all matrices into one
transforms = {
name: 'matrix',
data: transforms.reduce(function(a, b) {
return multiplyTransformMatrices(a, b);
})
data: transforms.length > 0 ? transforms.reduce(multiplyTransformMatrices) : []
};

return transforms;
Expand Down
2 changes: 2 additions & 0 deletions test/plugins/convertTransform.04.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1a3c32b

Please sign in to comment.