[frameworks/opt/net/wifi] Do gateway and dnsaddress null point check for network checker.

Signed-off-by: Firefly <service@t-firefly.com>
This commit is contained in:
Firefly
2015-08-26 10:42:29 +08:00
committed by djw
parent 29738f5914
commit 97664bf656

View File

@ -1233,6 +1233,10 @@ public class WifiStateMachine extends StateMachine {
String dns = null;
DhcpResults mDhcpResult = syncGetDhcpResults();
if (mDhcpResult != null) {
if (mDhcpResult.gateway == null || mDhcpResult.dnsServers == null) {
loge("gateway || dnsServers == null, turn off network checker.");
return;
}
String s = mDhcpResult.gateway.toString();
int space = s.indexOf('/');
gateway = s.substring(space + 1);