From c55b2fa1ae0cec757985c30b2bf4f8058b1ed9f3 Mon Sep 17 00:00:00 2001 From: "Hung-Han (Henry) Chen" Date: Mon, 4 Oct 2021 08:43:49 +0300 Subject: [PATCH] Add checks for svg, use only typeof material === string Signed-off-by: Hung-Han (Henry) Chen --- src/renderer/components/icon/icon.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renderer/components/icon/icon.tsx b/src/renderer/components/icon/icon.tsx index afa7b35aa9..48dfb51820 100644 --- a/src/renderer/components/icon/icon.tsx +++ b/src/renderer/components/icon/icon.tsx @@ -114,14 +114,14 @@ export class Icon extends React.PureComponent { }; // render as inline svg-icon - if (svg) { + if (typeof svg === "string") { const svgIconText = svg.includes("; } // render as material-icon - if (material && typeof material === "string") { + if (typeof material === "string") { iconContent = {material}; }