fix: guard EditorContent against null editor in tiptap 3.23.6

tiptap v3.19+ throws when EditorContent receives a null editor
(ueberdosis/tiptap#7529). useEditor() returns null on the first render
cycle before the instance is constructed — this was tolerated in 3.22.5
but crashes silently in 3.23.6, killing the entire ChannelPane subtree.
This commit is contained in:
Will Pfleger
2026-05-26 19:22:32 -04:00
parent a6f8b61abb
commit 846cd72c38
3 changed files with 3 additions and 3 deletions

View File

@@ -451,7 +451,7 @@ export function ForumComposer({
className="rich-text-composer max-h-32 overflow-y-auto"
onKeyDown={handleEditorKeyDown}
>
<EditorContent editor={richText.editor} />
{richText.editor && <EditorContent editor={richText.editor} />}
</div>
<MessageComposerToolbar

View File

@@ -31,7 +31,7 @@ export function ForumComposerCompactLayout({
className="rich-text-composer max-h-10 min-w-0 flex-1 overflow-y-auto"
onKeyDown={onEditorKeyDown}
>
<EditorContent editor={editor} />
{editor && <EditorContent editor={editor} />}
</div>
<Button
aria-label={isSending ? "Sending" : "Send message"}

View File

@@ -720,7 +720,7 @@ export function MessageComposer({
ref={composerScrollRef}
onKeyDown={handleEditorKeyDown}
>
<EditorContent editor={richText.editor} />
{richText.editor && <EditorContent editor={richText.editor} />}
</div>
<MessageComposerToolbar