Skip to content

Commit

Permalink
Fix NPE in DeviceMetadata
Browse files Browse the repository at this point in the history
Fixes #77
  • Loading branch information
lkorth committed Jan 8, 2016
1 parent b3e2ecb commit 490b797
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ static String isDeviceRooted() {
static String getNetworkType(Context context) {
ConnectivityManager connectivityManager =
(ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
return connectivityManager.getActiveNetworkInfo().getTypeName();
if (connectivityManager.getActiveNetworkInfo() != null) {
return connectivityManager.getActiveNetworkInfo().getTypeName();
}
return "none";
}

/**
Expand Down

0 comments on commit 490b797

Please sign in to comment.