aboutsummaryrefslogtreecommitdiffstats
path: root/main/src
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2013-08-25 15:50:10 +0200
committerSamuel Tardieu <sam@rfc1149.net>2013-08-25 15:50:10 +0200
commit1819980b8ed17932e71800e5de4b03346f3c0964 (patch)
tree224b37e417597fea8ebca9d119dd12db42bb652a /main/src
parentb4152df4f4ba146141e1494f0b019129cf2f7a5d (diff)
parent2f791d1a60f2ac41647ee75d7b0a3ef8365a7e31 (diff)
downloadcgeo-1819980b8ed17932e71800e5de4b03346f3c0964.zip
cgeo-1819980b8ed17932e71800e5de4b03346f3c0964.tar.gz
cgeo-1819980b8ed17932e71800e5de4b03346f3c0964.tar.bz2
Merge branch 'release' into upstream
Diffstat (limited to 'main/src')
-rw-r--r--main/src/cgeo/geocaching/settings/SettingsActivity.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/main/src/cgeo/geocaching/settings/SettingsActivity.java b/main/src/cgeo/geocaching/settings/SettingsActivity.java
index a444b36..4bcf279 100644
--- a/main/src/cgeo/geocaching/settings/SettingsActivity.java
+++ b/main/src/cgeo/geocaching/settings/SettingsActivity.java
@@ -481,8 +481,14 @@ public class SettingsActivity extends PreferenceActivity {
}
} else if (isPreference(preference, R.string.pref_mapsource)) {
// reset the cached map source
- int mapSourceId = Integer.valueOf(stringValue);
- MapSource mapSource = MapProviderFactory.getMapSource(mapSourceId);
+ MapSource mapSource;
+ try {
+ final int mapSourceId = Integer.valueOf(stringValue);
+ mapSource = MapProviderFactory.getMapSource(mapSourceId);
+ } catch (final NumberFormatException e) {
+ Log.e("SettingsActivity.onPreferenceChange: bad source id `" + stringValue + "'");
+ mapSource = null;
+ }
// If there is no corresponding map source (because some map sources were
// removed from the device since) then use the first one available.
if (mapSource == null) {