2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-22 18:07:55 +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

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.kde.kdeconnect_tp"
android:versionCode="1620"
android:versionCode="1621"
android:versionName="1.6.2">
<uses-sdk android:minSdkVersion="9"

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);