Skip to content

Commit dd65d40

Browse files
committed
see 09/08 log
1 parent f5e6ab5 commit dd65d40

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

utilcode/src/main/java/com/blankj/utilcode/utils/NetworkUtils.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ public static boolean is4G(Context context) {
103103
public static boolean isWifiConnected(Context context) {
104104
ConnectivityManager cm = (ConnectivityManager) context
105105
.getSystemService(Context.CONNECTIVITY_SERVICE);
106-
return cm != null && cm.getActiveNetworkInfo().getType() == ConnectivityManager.TYPE_WIFI;
106+
return cm != null && cm.getActiveNetworkInfo() != null
107+
&& cm.getActiveNetworkInfo().getType() == ConnectivityManager.TYPE_WIFI;
107108
}
108109

109110
/**

0 commit comments

Comments
 (0)