diff options
| author | Samuel Tardieu <sam@rfc1149.net> | 2012-12-18 20:58:08 +0100 |
|---|---|---|
| committer | Samuel Tardieu <sam@rfc1149.net> | 2012-12-18 21:00:07 +0100 |
| commit | 5368032229c7695acb499f0461b97c2ad359b7ff (patch) | |
| tree | f1b0967f00552e67ca4613d075f865427c2cb0a9 | |
| parent | dfb97a9382e4263d7ca5cdb2771fd31eea19e6aa (diff) | |
| download | cgeo-5368032229c7695acb499f0461b97c2ad359b7ff.zip cgeo-5368032229c7695acb499f0461b97c2ad359b7ff.tar.gz cgeo-5368032229c7695acb499f0461b97c2ad359b7ff.tar.bz2 | |
Fix crash on single cache map
It was due to a null searchIntent after the refactoring in
6191b4e2aa3b1dea8dd8a41f5396d5e069662f3f which assumes that the copy
constructor would not be called with a null value.
Found and diagnosed by rsudev.
| -rw-r--r-- | main/src/cgeo/geocaching/maps/CGeoMap.java | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/main/src/cgeo/geocaching/maps/CGeoMap.java b/main/src/cgeo/geocaching/maps/CGeoMap.java index 8156309..1f682cc 100644 --- a/main/src/cgeo/geocaching/maps/CGeoMap.java +++ b/main/src/cgeo/geocaching/maps/CGeoMap.java @@ -1119,14 +1119,10 @@ public class CGeoMap extends AbstractMap implements OnMapDragListener, ViewFacto SearchResult searchResult; if (mapMode == MapMode.LIVE) { - if (isLiveEnabled) { - searchResult = new SearchResult(); - } else { - searchResult = new SearchResult(cgData.loadStoredInViewport(viewport, Settings.getCacheType())); - } + searchResult = isLiveEnabled ? new SearchResult() : new SearchResult(cgData.loadStoredInViewport(viewport, Settings.getCacheType())); } else { // map started from another activity - searchResult = new SearchResult(searchIntent); + searchResult = searchIntent != null ? new SearchResult(searchIntent) : new SearchResult(); if (geocodeIntent != null) { searchResult.addGeocode(geocodeIntent); } |
