Check for null netmask
variable to prevent NPE.
Not sure if this is the correct course of action to prevent the problem, but it prevents the crash documented in Issue #413.
This commit is contained in:
parent
828cc272ee
commit
90ede44790
@ -86,7 +86,7 @@ public class WifiStateChangeService extends Service {
|
||||
wifiInfo = wifiManager.getConnectionInfo();
|
||||
FDroidApp.ipAddressString = formatIpAddress(wifiInfo.getIpAddress());
|
||||
String netmask = formatIpAddress(wifiManager.getDhcpInfo().netmask);
|
||||
if (!TextUtils.isEmpty(FDroidApp.ipAddressString))
|
||||
if (!TextUtils.isEmpty(FDroidApp.ipAddressString) && netmask != null)
|
||||
FDroidApp.subnetInfo = new SubnetUtils(FDroidApp.ipAddressString, netmask).getInfo();
|
||||
} else if (wifiState == WifiManager.WIFI_STATE_DISABLED
|
||||
|| wifiState == WifiManager.WIFI_STATE_DISABLING) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user