diff options
author | Arne Schwabe <arne@rfc2549.org> | 2021-10-09 18:26:16 +0200 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2021-10-09 18:26:16 +0200 |
commit | ddc7c919c2c20c888518da38b7ed5d283e1b0a39 (patch) | |
tree | 7560eaf95f9cdfa8fcca5450eda97a4a42a65412 /main/src/ui | |
parent | ab67684d37a81077312df6e894f282a9b83879dd (diff) |
Fix some corner case NPE report by play console
Diffstat (limited to 'main/src/ui')
-rw-r--r-- | main/src/ui/java/de/blinkt/openvpn/activities/VPNPreferences.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/main/src/ui/java/de/blinkt/openvpn/activities/VPNPreferences.java b/main/src/ui/java/de/blinkt/openvpn/activities/VPNPreferences.java index 49d4161c..2c9eb761 100644 --- a/main/src/ui/java/de/blinkt/openvpn/activities/VPNPreferences.java +++ b/main/src/ui/java/de/blinkt/openvpn/activities/VPNPreferences.java @@ -115,12 +115,16 @@ public class VPNPreferences extends BaseActivity { if(savedUUID!=null) mProfileUUID=savedUUID; } + super.onCreate(savedInstanceState); mProfile = ProfileManager.get(this,mProfileUUID); - if(mProfile!=null) { - setTitle(getString(R.string.edit_profile_title, mProfile.getName())); + if(mProfile==null) { + Toast.makeText(this, "Profile to edit cannot be found.", Toast.LENGTH_LONG).show(); + finish(); + return; } - super.onCreate(savedInstanceState); + + setTitle(getString(R.string.edit_profile_title, mProfile.getName())); setContentView(R.layout.main_activity); |