From e49897ab5a5df804ecdbbd4d96f17936b6f71fbf Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Mon, 25 Apr 2022 21:13:06 -0700 Subject: [PATCH] fix: Account for rare case where file.name is unavailable --- shared/editor/commands/insertFiles.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared/editor/commands/insertFiles.ts b/shared/editor/commands/insertFiles.ts index f88ee872fb..054a94045c 100644 --- a/shared/editor/commands/insertFiles.ts +++ b/shared/editor/commands/insertFiles.ts @@ -83,7 +83,7 @@ const insertFiles = function ( $pos.pos + ($pos.nodeAfter?.nodeSize || 0), schema.nodes.attachment.create({ id, - title: file.name, + title: file.name ?? "Untitled", size: file.size, }) ) @@ -149,7 +149,7 @@ const insertFiles = function ( to || from, schema.nodes.attachment.create({ href: src, - title: file.name, + title: file.name ?? "Untitled", size: file.size, }) )