fix: Account for rare case where file.name is unavailable

This commit is contained in:
Tom Moor
2022-04-25 21:13:06 -07:00
parent ceebc922cf
commit e49897ab5a

View File

@@ -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,
})
)