aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2014-08-31 23:15:52 +0200
committerSamuel Tardieu <sam@rfc1149.net>2014-08-31 23:15:52 +0200
commit6b794ef25bd8aaec8649519009de7b8df6afb148 (patch)
tree166ad478c205a7a5d62286f8fef7e857f5134938
parente9bff24acf6dea743cfbf0969d81a0800b870b33 (diff)
downloadcgeo-6b794ef25bd8aaec8649519009de7b8df6afb148.zip
cgeo-6b794ef25bd8aaec8649519009de7b8df6afb148.tar.gz
cgeo-6b794ef25bd8aaec8649519009de7b8df6afb148.tar.bz2
fix #4289: NPE in switchMyLocationButton
-rw-r--r--main/src/cgeo/geocaching/maps/CGeoMap.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/main/src/cgeo/geocaching/maps/CGeoMap.java b/main/src/cgeo/geocaching/maps/CGeoMap.java
index c41291e..8aae0cc 100644
--- a/main/src/cgeo/geocaching/maps/CGeoMap.java
+++ b/main/src/cgeo/geocaching/maps/CGeoMap.java
@@ -1536,9 +1536,12 @@ public class CGeoMap extends AbstractMap implements ViewFactory {
// switch My Location button image
private void switchMyLocationButton() {
- myLocSwitch.setChecked(followMyLocation);
- if (followMyLocation) {
- myLocationInMiddle(app.currentGeo());
+ // FIXME: temporary workaround for the absence of "follow my location" on Android 3.x (see issue #4289).
+ if (myLocSwitch != null) {
+ myLocSwitch.setChecked(followMyLocation);
+ if (followMyLocation) {
+ myLocationInMiddle(app.currentGeo());
+ }
}
}