fix: Cannot read properties of null (reading '0')

This commit is contained in:
Tom Moor committed 2025-02-03 20:00:48 -05:00
1 parent c990ace2e2
commit 9a94e2dcf2
1 file changed
+5 -1
+5 -1
View File
@@ -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);
}
});