aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorBananeweizen <Bananeweizen@gmx.de>2012-08-26 00:54:31 -0700
committerBananeweizen <Bananeweizen@gmx.de>2012-08-26 00:54:31 -0700
commit20a1a96d3844a873408c992a25077a022267178f (patch)
tree8fd34b6182bb4d711514befe7c32ac14b0896cba /main
parentb2665c6ec6db690d3ced32eca91b11eea7adfa93 (diff)
parent4f7d53b4df007a7a135cd01a6bc00160a61e7253 (diff)
downloadcgeo-20a1a96d3844a873408c992a25077a022267178f.zip
cgeo-20a1a96d3844a873408c992a25077a022267178f.tar.gz
cgeo-20a1a96d3844a873408c992a25077a022267178f.tar.bz2
Merge pull request #1957 from RuneHL/release
Fix for null coords to allow "Store for offline"
Diffstat (limited to 'main')
-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