Skip to content

Commit 12b8f15

Browse files
committed
chore: guard e.target before calling closest()
1 parent cbb73c4 commit 12b8f15

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/pages/about.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ function toggle(c: GitHubContributor, btnEl: HTMLElement) {
135135
136136
function onDocumentPointerDown(e: PointerEvent) {
137137
if (!activeContributor.value) return
138-
const t = e.target as HTMLElement
138+
const t = e.target
139+
if (!(t instanceof Element)) return
139140
if (
140141
!t.closest('[data-popover-panel]') &&
141142
!t.closest(`[data-cid="${activeContributor.value.id}"]`)

0 commit comments

Comments
 (0)