diff options
author | Oliver Crow <ocrow@matriculus.com> | 2018-01-28 18:05:35 -0800 |
---|---|---|
committer | Oliver Crow <ocrow@matriculus.com> | 2018-01-28 18:05:35 -0800 |
commit | 8090431d302db205cdc54bd2d2e2d32ce5e751c0 (patch) | |
tree | 8d470d3f0f9e1afae600b70b4352ffda55cc6b39 /app/src | |
parent | 287bb5f7e1ba528d4cc322a959d51627dbbb3c7b (diff) | |
download | AntennaPod-8090431d302db205cdc54bd2d2e2d32ce5e751c0.zip |
Fix for #2555 - can't open Preferences activity when there are stored WiFi connections with null SSID.
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java b/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java index b5e0f1e99..0f42dd01a 100644 --- a/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java +++ b/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java @@ -764,6 +764,10 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc } } + private static String blankIfNull(String val) { + return val == null ? "" : val; + } + private void buildAutodownloadSelectedNetworsPreference() { final Activity activity = ui.getActivity(); @@ -778,7 +782,8 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc Log.e(TAG, "Couldn't get list of configure Wi-Fi networks"); return; } - Collections.sort(networks, (x, y) -> x.SSID.compareTo(y.SSID)); + Collections.sort(networks, (x, y) -> + blankIfNull(x.SSID).compareTo(blankIfNull(y.SSID))); selectedNetworks = new CheckBoxPreference[networks.size()]; List<String> prefValues = Arrays.asList(UserPreferences .getAutodownloadSelectedNetworks()); |