vasturiano / globe.gl

UI component for Globe Data Visualization using ThreeJS/WebGL
https://vasturiano.github.io/globe.gl/example/world-population/
MIT License
2.03k stars 301 forks source link

Fix exception when hovering at the edge of the globe #42

Closed olaszakos closed 3 years ago

olaszakos commented 3 years ago

Hi, and thank you for this awesome library!

I ran into the same issue as the guys here: https://github.com/vasturiano/react-globe.gl/issues/46

I found that this is due to a missing null check.

Steps to reproduce the issue (at least on Chrome, Mac):

  1. open for instance the basic example https://globe.gl/example/basic/
  2. open the JS console to see the error
  3. start hovering at the edge of the globe, where the atmosphere and Earth meet
  4. you get the error which stops further event processing (the globe "locks up")

This pull request adds the null check.

vasturiano commented 3 years ago

Thanks @olaszakos for your fix! Indeed there was a missing null check there. I've adjusted the condition slightly, but the outcome is the same as in your code. 👍