π₯π₯π₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.
TypeScript boardsbug-trackerdjangodockerganttissue-trackerjirajira-alternativekanbanlinearpostgresqlproduct-managementproject-managementproject-planningpythonreactredistypesciptvitework-management
[WEB-2424] fix: add optional chaining for parent node (#5571)
Aaryan Khandelwalcc07992e47a3
diff --git a/packages/editor/src/core/extensions/custom-link/helpers/clickHandler.ts b/packages/editor/src/core/extensions/custom-link/helpers/clickHandler.tsindex ec6c540dac..1b084d1ac5 100644--- a/packages/editor/src/core/extensions/custom-link/helpers/clickHandler.ts+++ b/packages/editor/src/core/extensions/custom-link/helpers/clickHandler.ts@@ -18,9 +18,9 @@ export function clickHandler(options: ClickHandlerOptions): Plugin {let a = event.target as HTMLElement;const els = [];- while (a.nodeName !== "DIV") {+ while (a?.nodeName !== "DIV") {els.push(a);- a = a.parentNode as HTMLElement;+ a = a?.parentNode as HTMLElement;}if (!els.find((value) => value.nodeName === "A")) {diff --git a/packages/editor/src/core/extensions/slash-commands.tsx b/packages/editor/src/core/extensions/slash-commands.tsxindex a61198db2b..78aa379576 100644--- a/packages/editor/src/core/extensions/slash-commands.tsx+++ b/packages/editor/src/core/extensions/slash-commands.tsx@@ -63,7 +63,7 @@ const Command = Extension.create<SlashCommandOptions>({const { selection } = editor.state;const parentNode = selection.$from.node(selection.$from.depth);- const blockType = parentNode.type.name;+ const blockType = parentNode?.type?.name;if (blockType === "codeBlock") {return false;diff --git a/yarn.lock b/yarn.lockindex cc59ff6ff5..cec3a100ba 100644--- a/yarn.lock+++ b/yarn.lock@@ -13146,4 +13146,4 @@ zeed-dom@^0.10.9:zxcvbn@^4.4.2:version "4.4.2"resolved "https://registry.yarnpkg.com/zxcvbn/-/zxcvbn-4.4.2.tgz#28ec17cf09743edcab056ddd8b1b06262cc73c30"- integrity sha512-Bq0B+ixT/DMyG8kgX2xWcI5jUvCwqrMxSFam7m0lAf78nf04hv6lNCsyLYdyYTrCVMqNDY/206K7eExYCeSyUQ==+ integrity sha512-Bq0B+ixT/DMyG8kgX2xWcI5jUvCwqrMxSFam7m0lAf78nf04hv6lNCsyLYdyYTrCVMqNDY/206K7eExYCeSyUQ==\ No newline at end of file