Skip to content

Commit d44c3c1

Browse files
authored
Merge pull request #27 from celestial-orbit/main
Fix indexOf of undefined value
2 parents 71a4038 + 732e740 commit d44c3c1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

context.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ export default (function () {
413413
//gradient
414414
currentElement.setAttribute(style.apply, format("url(#{id})", {id:value.__root.getAttribute("id")}));
415415
} else if (style.apply.indexOf(type)!==-1 && style.svg !== value) {
416-
if ((style.svgAttr === "stroke" || style.svgAttr === "fill") && value.indexOf("rgba") !== -1) {
416+
if ((style.svgAttr === "stroke" || style.svgAttr === "fill") && value && value.indexOf("rgba") !== -1) {
417417
//separate alpha value, since illustrator can't handle it
418418
regex = /rgba\(\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi;
419419
matches = regex.exec(value);

0 commit comments

Comments
 (0)