aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/cgeo')
-rw-r--r--main/src/cgeo/geocaching/geopoint/Viewport.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/main/src/cgeo/geocaching/geopoint/Viewport.java b/main/src/cgeo/geocaching/geopoint/Viewport.java
index 7d3fb57..9095f53 100644
--- a/main/src/cgeo/geocaching/geopoint/Viewport.java
+++ b/main/src/cgeo/geocaching/geopoint/Viewport.java
@@ -71,7 +71,8 @@ public class Viewport {
*/
public boolean contains(final ICoordinates point) {
final Geopoint coords = point.getCoords();
- return coords.getLongitudeE6() >= bottomLeft.getLongitudeE6()
+ return coords != null
+ && coords.getLongitudeE6() >= bottomLeft.getLongitudeE6()
&& coords.getLongitudeE6() <= topRight.getLongitudeE6()
&& coords.getLatitudeE6() >= bottomLeft.getLatitudeE6()
&& coords.getLatitudeE6() <= topRight.getLatitudeE6();
@@ -120,7 +121,7 @@ public class Viewport {
/**
* Return a viewport that contains the current viewport as well as another point.
- *
+ *
* @param point
* the point we want in the viewport
* @return either the same or an expanded viewport