From 9a94e2dcf26cdff906f4a83451666fcf5282d719 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Mon, 3 Feb 2025 20:00:48 -0500 Subject: [PATCH] fix: Cannot read properties of null (reading '0') --- shared/editor/plugins/UploadPlugin.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/shared/editor/plugins/UploadPlugin.ts b/shared/editor/plugins/UploadPlugin.ts index 26c2e898c8..65a0313847 100644 --- a/shared/editor/plugins/UploadPlugin.ts +++ b/shared/editor/plugins/UploadPlugin.ts @@ -102,7 +102,11 @@ export class UploadPlugin extends Plugin { // find any remote images in pasted slice, but leave it alone. const images: Node[] = []; slice.content.descendants((node) => { - if (node.type.name === "image" && !isInternalUrl(node.attrs.src)) { + if ( + node.type.name === "image" && + node.attrs.src && + !isInternalUrl(node.attrs.src) + ) { images.push(node); } });