mirror of
https://github.com/M66B/NetGuard.git
synced 2024-12-27 18:30:09 +00:00
Fixed home wifi crash
This commit is contained in:
parent
846110c8c9
commit
69d943d78b
2 changed files with 3 additions and 2 deletions
|
@ -123,7 +123,7 @@ public class ActivitySettings extends AppCompatActivity implements SharedPrefere
|
|||
List<WifiConfiguration> configs = wm.getConfiguredNetworks();
|
||||
if (configs != null)
|
||||
for (WifiConfiguration config : configs)
|
||||
listSSID.add(config.SSID);
|
||||
listSSID.add(config.SSID == null ? "NULL" : config.SSID);
|
||||
pref_wifi_homes.setEntries(listSSID.toArray(new CharSequence[0]));
|
||||
pref_wifi_homes.setEntryValues(listSSID.toArray(new CharSequence[0]));
|
||||
|
||||
|
|
|
@ -111,7 +111,8 @@ public class Util {
|
|||
|
||||
public static String getWifiSSID(Context context) {
|
||||
WifiManager wm = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
|
||||
return wm.getConnectionInfo().getSSID();
|
||||
String ssid = wm.getConnectionInfo().getSSID();
|
||||
return (ssid == null ? "NULL" : ssid);
|
||||
}
|
||||
|
||||
public static int getNetworkType(Context context) {
|
||||
|
|
Loading…
Reference in a new issue