WifiStateChangeService: handle BSSID when WifiConfiguration is null
fixes: java.lang.NullPointerException: Attempt to read from field 'java.lang.String android.net.wifi.WifiConfiguration.BSSID' on a null object reference at org.fdroid.fdroid.nearby.WifiStateChangeService.setSsid(WifiStateChangeService.java:265) at org.fdroid.fdroid.nearby.WifiStateChangeService.access$100(WifiStateChangeService.java:59) at org.fdroid.fdroid.nearby.WifiStateChangeService$WifiInfoThread.run(WifiStateChangeService.java:174)
This commit is contained in:
parent
915aeb6c54
commit
d233b03029
@ -257,7 +257,11 @@ public class WifiStateChangeService extends IntentService {
|
||||
Utils.debugLog(TAG, "WifiConfiguration: " + wifiConfiguration);
|
||||
if (wifiConfiguration == null) {
|
||||
FDroidApp.ssid = getString(R.string.swap_active_hotspot, "");
|
||||
} else if (wifiConfiguration.hiddenSSID) {
|
||||
FDroidApp.bssid = "";
|
||||
return;
|
||||
}
|
||||
|
||||
if (wifiConfiguration.hiddenSSID) {
|
||||
FDroidApp.ssid = getString(R.string.swap_hidden_wifi_ssid);
|
||||
} else {
|
||||
FDroidApp.ssid = wifiConfiguration.SSID;
|
||||
|
Loading…
x
Reference in New Issue
Block a user