fix: return "" instead of return undefined (#1133)

the function renderGradient may return  undefined if colors.bgColor !== "object"

which may render "undefined" into svg
This commit is contained in:
JacobLinCool
2021-06-24 22:34:13 +05:30
committed by GitHub
parent e088a16151
commit dfecef5c34
+1 -1
View File
@@ -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"