]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
android: Fix a potential NullPointerException in the IMC state fragment
authorTobias Brunner <tobias@strongswan.org>
Mon, 22 Jun 2015 15:22:05 +0000 (17:22 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 22 Jun 2015 15:39:53 +0000 (17:39 +0200)
src/frontends/android/src/org/strongswan/android/ui/ImcStateFragment.java

index 39f86b460039089de1f406418c2319c7bdf33838..7680ee66553c43374d89b14cadb2c872437656f8 100644 (file)
@@ -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())
                {