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-25 01:04:13 +08:00 committed by GitHub
parent e088a16151
commit dfecef5c34
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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"