Skip to content

Commit

Permalink
#1079 npe checks
Browse files Browse the repository at this point in the history
  • Loading branch information
spyhunter99 committed Jul 16, 2018
1 parent 25a117a commit fb326b2
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -405,9 +405,12 @@ public void save(Context ctx, SharedPreferences prefs) {
*/
private static void load(final SharedPreferences pPrefs,
final Map<String, String> pMap, final String pPrefix) {
//potential fix for #1079 https://github.com/osmdroid/osmdroid/issues/1079
if (pPrefix==null || pMap==null) return;
pMap.clear();

for (final String key : pPrefs.getAll().keySet()) {
if (key.startsWith(pPrefix)) {
if (key!=null && key.startsWith(pPrefix)) {
pMap.put(key.substring(pPrefix.length()), pPrefs.getString(key, null));
}
}
Expand Down

0 comments on commit fb326b2

Please sign in to comment.