From a3ad1a99dfc0d21024bc32a8e013ad697d0e243b Mon Sep 17 00:00:00 2001 From: zubiden <19638254+zubiden@users.noreply.github.com> Date: Wed, 8 Oct 2025 12:33:39 +0200 Subject: [PATCH] Quick Preview: Fix error after passcode (#6331) --- src/components/modals/quickPreview/QuickPreviewModal.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/modals/quickPreview/QuickPreviewModal.tsx b/src/components/modals/quickPreview/QuickPreviewModal.tsx index e2da75b18..2e87d56ba 100644 --- a/src/components/modals/quickPreview/QuickPreviewModal.tsx +++ b/src/components/modals/quickPreview/QuickPreviewModal.tsx @@ -72,7 +72,7 @@ const QuickPreviewModal: FC = ({ onBack: handleClose, }); - const { chatId: renderingChatId, threadId: renderingThreadId } = useCurrentOrPrev(modal, true)!; + const { chatId: renderingChatId, threadId: renderingThreadId } = useCurrentOrPrev(modal, true) || {}; const bgClassName = buildClassName( backgroundStyles.background, @@ -81,6 +81,10 @@ const QuickPreviewModal: FC = ({ customBackground && isBackgroundBlurred && backgroundStyles.blurred, ); + if (!renderingChatId) { + return undefined; + } + return (