Skip to content

Commit a554e21

Browse files
deyihufuzhenn
authored andcommitted
fix Array overflow
1 parent 559c44f commit a554e21

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/ui/InfoWindow.js

+6
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,12 @@ class InfoWindow extends UIComponent {
346346
ptIndex = i;
347347
}
348348
}
349+
if (ptIndex < 0) {
350+
return {
351+
dist: minPtDis,
352+
coordinate: mouseCoordinate
353+
};
354+
}
349355
const point = new Point(xys[ptIndex].x, xys[ptIndex].y);
350356
return {
351357
dis: minPtDis,

0 commit comments

Comments
 (0)