From 4f7d53b4df007a7a135cd01a6bc00160a61e7253 Mon Sep 17 00:00:00 2001 From: runehl Date: Tue, 14 Aug 2012 16:59:17 +0200 Subject: Fix for null coords --- main/src/cgeo/geocaching/geopoint/Viewport.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'main/src/cgeo/geocaching/geopoint') 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 -- cgit v1.1