2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-09-06 00:55:10 +00:00

Fix crash when fragment.getContext() was null

This commit is contained in:
Albert Vaca
2017-02-25 21:41:55 +01:00
parent 9580154a13
commit c93e4400e2
2 changed files with 2 additions and 2 deletions

View File

@@ -8,7 +8,7 @@ import android.net.NetworkInfo;
public class NetworkHelper {
public static boolean isOnMobileNetwork(Context context) {
if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.LOLLIPOP) {
if (context == null || android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.LOLLIPOP) {
return false; //No good way to know it
}
final ConnectivityManager connMgr = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);