From 30497a89f2f91c6ca704a3f7997e7ccc93c45f39 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 25 Mar 2026 19:41:25 +0000 Subject: [PATCH] fix: add typeof string type guard for toast description in anchored toast The floating toast correctly guarded with typeof toast.description === 'string' before passing to CopyErrorButton, but the anchored toast only checked truthiness. This could pass non-string values (e.g. React nodes) to clipboard.writeText(). --- apps/web/src/components/ui/toast.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/components/ui/toast.tsx b/apps/web/src/components/ui/toast.tsx index 7726b1ea9f..a55e36c195 100644 --- a/apps/web/src/components/ui/toast.tsx +++ b/apps/web/src/components/ui/toast.tsx @@ -405,7 +405,7 @@ function AnchoredToasts() { className="min-w-0 break-words font-medium" data-slot="toast-title" /> - {toast.type === "error" && toast.description && ( + {toast.type === "error" && typeof toast.description === "string" && ( )}