From dfecef5c34adc188c45d7e298939309121955987 Mon Sep 17 00:00:00 2001 From: JacobLinCool Date: Fri, 25 Jun 2021 01:04:13 +0800 Subject: [PATCH] fix: return "" instead of return undefined (#1133) the function renderGradient may return undefined if colors.bgColor !== "object" which may render "undefined" into svg --- src/common/Card.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/Card.js b/src/common/Card.js index 3b5686e..520560f 100644 --- a/src/common/Card.js +++ b/src/common/Card.js @@ -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"