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().
This commit is contained in:
Cursor Agent committed 2026-03-25 19:41:25 +00:00
1 parent 5568558b50
commit 30497a89f2
1 file changed
+1 -1
+1 -1
View File
@@ -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" && (
<CopyErrorButton text={toast.description} />
)}
</div>