mirror of
https://github.com/svg/svgo.git
synced 2025-08-07 15:22:54 +03:00
Fix error due to invalid transform. Close #846
This commit is contained in:
@@ -42,8 +42,8 @@ exports.transform2js = function(transformString) {
|
||||
}
|
||||
});
|
||||
|
||||
return transforms;
|
||||
|
||||
// return empty array if broken transform (no data)
|
||||
return current && current.data ? transforms : [];
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -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;
|
||||
|
Reference in New Issue
Block a user