Fixed IndexOutOfBoundsException when clicking outside of the map.