Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

editor: fix editor crash due to `TypeError: t.startsWith is not a function`

Abdullah Atta533f95fcff6d
diff --git a/packages/editor/src/toolbar/tools/link.tsx b/packages/editor/src/toolbar/tools/link.tsx
index 0d5e1397a..3ac63d9e2 100644
--- a/packages/editor/src/toolbar/tools/link.tsx
+++ b/packages/editor/src/toolbar/tools/link.tsx
@@ -301,5 +301,5 @@ function LinkTool(props: LinkToolProps) {
}
function isInternalLink(href?: string | null) {
- return !!href?.startsWith("nn://");
+ return typeof href === "string" ? href.startsWith("nn://") : false;
}