diff options
Diffstat (limited to 'src/cgeo/geocaching/cgDistanceView.java')
| -rw-r--r-- | src/cgeo/geocaching/cgDistanceView.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/cgeo/geocaching/cgDistanceView.java b/src/cgeo/geocaching/cgDistanceView.java index ae9e7b7..2e17247 100644 --- a/src/cgeo/geocaching/cgDistanceView.java +++ b/src/cgeo/geocaching/cgDistanceView.java @@ -27,11 +27,10 @@ public class cgDistanceView extends TextView { } public void update(final Geopoint coords) { - if (cacheCoords == null) return; - if (coords == null) return; - if (base == null) return; - - setText(base.getHumanDistance(cgBase.getDistance(coords, cacheCoords))); + if (cacheCoords == null || coords == null || base == null) { + return; + } + setText(base.getHumanDistance(coords.distanceTo(cacheCoords))); } public void setDistance(Double distance) { |
