android: Fix a potential NullPointerException in the IMC state fragment

This commit is contained in:
Tobias Brunner
2015-07-28 13:27:31 +02:00
parent 4dc6275be5
commit 16e9efc092
@@ -24,6 +24,7 @@ import org.strongswan.android.logic.imc.ImcState;
import org.strongswan.android.logic.imc.RemediationInstruction; import org.strongswan.android.logic.imc.RemediationInstruction;
import android.app.Fragment; import android.app.Fragment;
import android.app.FragmentManager;
import android.app.FragmentTransaction; import android.app.FragmentTransaction;
import android.app.Service; import android.app.Service;
import android.content.ComponentName; import android.content.ComponentName;
@@ -174,7 +175,12 @@ public class ImcStateFragment extends Fragment implements VpnStateListener
public void updateView() public void updateView()
{ {
FragmentTransaction ft = getFragmentManager().beginTransaction(); FragmentManager fm = getFragmentManager();
if (fm == null)
{
return;
}
FragmentTransaction ft = fm.beginTransaction();
switch (mService.getImcState()) switch (mService.getImcState())
{ {