Skip to content

Commit

Permalink
fix: return "" instead of return undefined (anuraghazra#1133)
Browse files Browse the repository at this point in the history
the function renderGradient may return  undefined if colors.bgColor !== "object"

which may render "undefined" into svg
  • Loading branch information
JacobLinCool authored Jun 24, 2021
1 parent e088a16 commit dfecef5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/common/Card.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class Card {
}

renderGradient() {
if (typeof this.colors.bgColor !== "object") return;
if (typeof this.colors.bgColor !== "object") return "";

const gradients = this.colors.bgColor.slice(1);
return typeof this.colors.bgColor === "object"
Expand Down

0 comments on commit dfecef5

Please sign in to comment.