From da7e8ad2b6fafe7f5ca3c0d59a515b5c4c0350ef Mon Sep 17 00:00:00 2001 From: Vanessa Date: Fri, 11 Nov 2022 09:26:02 +0800 Subject: [PATCH] :bug: fix https://github.com/siyuan-note/siyuan/issues/6540 --- app/src/protyle/toolbar/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/protyle/toolbar/index.ts b/app/src/protyle/toolbar/index.ts index c97b471d6..8d92a3d20 100644 --- a/app/src/protyle/toolbar/index.ts +++ b/app/src/protyle/toolbar/index.ts @@ -338,7 +338,7 @@ export class Toolbar { const types = item.getAttribute("data-type").split(" "); if (type === "clear") { for (let i = 0; i < types.length; i++) { - if (textObj.type === "text") { + if (textObj && textObj.type === "text") { if ("text" === types[i]) { types.splice(i, 1); i--;