diff options
author | runehl <runehl@hotmail.com> | 2012-08-14 16:59:17 +0200 |
---|---|---|
committer | runehl <runehl@hotmail.com> | 2012-08-14 16:59:17 +0200 |
commit | 4f7d53b4df007a7a135cd01a6bc00160a61e7253 (patch) | |
tree | 3c7cea82bdfe4f7a7e2c58bc06275c071cedc3de /main/src | |
parent | d4da79612fce0525fd356ecf7f02964905626762 (diff) | |
download | cgeo-4f7d53b4df007a7a135cd01a6bc00160a61e7253.zip cgeo-4f7d53b4df007a7a135cd01a6bc00160a61e7253.tar.gz cgeo-4f7d53b4df007a7a135cd01a6bc00160a61e7253.tar.bz2 |
Fix for null coords
Diffstat (limited to 'main/src')
-rw-r--r-- | main/src/cgeo/geocaching/geopoint/Viewport.java | 5 |
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 |