Skip to content

Commit 0da7850

Browse files
authored
fix(ui): defensive indexed access in getItemIndexAtPosition (#93900)
fixes JAVASCRIPT-31AG
1 parent ba182b2 commit 0da7850

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

static/app/components/searchQueryBuilder/hooks/useSelectOnDrag.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ function getItemIndexAtPosition(
8686
x: number,
8787
y: number
8888
) {
89-
for (let i = 0; i < keys.length; i++) {
90-
const key = keys[i]!;
91-
const coords = coordinates[key]!;
89+
for (const [i, key] of keys.entries()) {
90+
const coords = coordinates[key];
91+
if (!coords) continue;
9292

9393
// If we are above this item, we must be in between this and the
9494
// previous item on the row above it.

0 commit comments

Comments
 (0)