]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
android: Catch NullPointerException when calling VpnService.prepare()
authorTobias Brunner <tobias@strongswan.org>
Thu, 6 Jul 2017 13:16:24 +0000 (15:16 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 4 Sep 2017 08:41:24 +0000 (10:41 +0200)
According to the Play Console this occurs occasionally.

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

index efdeddd4846b8e49e13ee676d90da23fb30becfa..a7006cd4918e872e547845f352f70b26f402d0ca 100644 (file)
@@ -218,6 +218,12 @@ public class MainActivity extends AppCompatActivity implements OnVpnProfileSelec
                        VpnNotSupportedError.showWithMessage(this, R.string.vpn_not_supported_during_lockdown);
                        return;
                }
+               catch (NullPointerException ex)
+               {
+                       /* not sure when this happens exactly, but apparently it does */
+                       VpnNotSupportedError.showWithMessage(this, R.string.vpn_not_supported);
+                       return;
+               }
                /* store profile info until the user grants us permission */
                mProfileInfo = profileInfo;
                if (intent != null)