summaryrefslogtreecommitdiff
path: root/main/src/ui
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2021-10-09 18:26:16 +0200
committerArne Schwabe <arne@rfc2549.org>2021-10-09 18:26:16 +0200
commitddc7c919c2c20c888518da38b7ed5d283e1b0a39 (patch)
tree7560eaf95f9cdfa8fcca5450eda97a4a42a65412 /main/src/ui
parentab67684d37a81077312df6e894f282a9b83879dd (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.java10
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);