From a9ab196a18b14f0e0dcbeb73df966c9db4ee1037 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Tue, 11 Jul 2023 20:40:48 -0400 Subject: [PATCH] fix: Guard against empty attachment size I don't see how this can happen based on default props, but it does --- shared/editor/nodes/Attachment.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/editor/nodes/Attachment.tsx b/shared/editor/nodes/Attachment.tsx index 3e889e4fa..e0e51c916 100644 --- a/shared/editor/nodes/Attachment.tsx +++ b/shared/editor/nodes/Attachment.tsx @@ -86,7 +86,7 @@ export default class Attachment extends Node { onMouseDown={this.handleSelect(props)} context={ node.attrs.href ? ( - bytesToHumanReadable(node.attrs.size) + bytesToHumanReadable(node.attrs.size || "0") ) : ( <> Uploading