From: Tobias Brunner Date: Mon, 22 Jun 2015 15:22:05 +0000 (+0200) Subject: android: Fix a potential NullPointerException in the IMC state fragment X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=fd176afc8d409c47d8daa3cb91e632ef313c888c;p=thirdparty%2Fstrongswan.git android: Fix a potential NullPointerException in the IMC state fragment --- diff --git a/src/frontends/android/src/org/strongswan/android/ui/ImcStateFragment.java b/src/frontends/android/src/org/strongswan/android/ui/ImcStateFragment.java index 39f86b4600..7680ee6655 100644 --- a/src/frontends/android/src/org/strongswan/android/ui/ImcStateFragment.java +++ b/src/frontends/android/src/org/strongswan/android/ui/ImcStateFragment.java @@ -24,6 +24,7 @@ import org.strongswan.android.logic.imc.ImcState; import org.strongswan.android.logic.imc.RemediationInstruction; import android.app.Fragment; +import android.app.FragmentManager; import android.app.FragmentTransaction; import android.app.Service; import android.content.ComponentName; @@ -174,7 +175,12 @@ public class ImcStateFragment extends Fragment implements VpnStateListener public void updateView() { - FragmentTransaction ft = getFragmentManager().beginTransaction(); + FragmentManager fm = getFragmentManager(); + if (fm == null) + { + return; + } + FragmentTransaction ft = fm.beginTransaction(); switch (mService.getImcState()) {