From b997d00947e7a1cb72bcf53cdf8623e0082b7966 Mon Sep 17 00:00:00 2001 From: G30 <50341825+silentoplayz@users.noreply.github.com> Date: Tue, 30 Dec 2025 11:05:55 -0500 Subject: [PATCH] fix: prevent crash when regenerating message with missing parent (#20264) --- src/lib/components/chat/Chat.svelte | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index c5221d6f6..a423b1694 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -2141,6 +2141,11 @@ if (history.currentId) { let userMessage = history.messages[message.parentId]; + if (!userMessage) { + toast.error($i18n.t('Parent message not found')); + return; + } + if (autoScroll) { scrollToBottom(); }