android: Don't update state fragment if not attached to an Activity
authorTobias Brunner <tobias@strongswan.org>
Fri, 21 Apr 2017 11:59:04 +0000 (13:59 +0200)
committerTobias Brunner <tobias@strongswan.org>
Fri, 30 Jun 2017 07:32:27 +0000 (09:32 +0200)
When the bound state service finally connects we might not actually be
attached to an Activity.

src/frontends/android/app/src/main/java/org/strongswan/android/ui/VpnStateFragment.java

index 1ea0151..0a8e1f3 100644 (file)
@@ -189,6 +189,11 @@ public class VpnStateFragment extends Fragment implements VpnStateListener
                ImcState imcState = mService.getImcState();
                String name = "";
 
+               if (getActivity() == null)
+               {
+                       return;
+               }
+
                if (profile != null)
                {
                        name = profile.getName();