From 27095a649cac5334a132cf52b400eff1f7555188 Mon Sep 17 00:00:00 2001 From: GUSTAVO AVELINO SARAIVA OLIVEIRA Date: Sun, 31 May 2026 14:12:05 -0300 Subject: [PATCH 1/2] fix: guard against null value in useValue (avoid 'in' on null) --- cmdk/src/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmdk/src/index.tsx b/cmdk/src/index.tsx index 3131c7b6..a23b61a3 100644 --- a/cmdk/src/index.tsx +++ b/cmdk/src/index.tsx @@ -1023,7 +1023,7 @@ function useValue( return part.trim() } - if (typeof part === 'object' && 'current' in part) { + if (part && typeof part === 'object' && 'current' in part) { if (part.current) { return part.current.textContent?.trim() } @@ -1088,4 +1088,4 @@ const srOnlyStyles = { clip: 'rect(0, 0, 0, 0)', whiteSpace: 'nowrap', borderWidth: '0', -} as const +} as const \ No newline at end of file From fe8f577cdf811f1f4bd84d25a16a5ea78248e2d2 Mon Sep 17 00:00:00 2001 From: GUSTAVO AVELINO SARAIVA OLIVEIRA Date: Sun, 31 May 2026 14:13:44 -0300 Subject: [PATCH 2/2] chore: restore trailing newline --- cmdk/src/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmdk/src/index.tsx b/cmdk/src/index.tsx index a23b61a3..4db74880 100644 --- a/cmdk/src/index.tsx +++ b/cmdk/src/index.tsx @@ -1088,4 +1088,4 @@ const srOnlyStyles = { clip: 'rect(0, 0, 0, 0)', whiteSpace: 'nowrap', borderWidth: '0', -} as const \ No newline at end of file +} as const