]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
android: Don't print "null" if no user certificate is selected
authorTobias Brunner <tobias@strongswan.org>
Fri, 26 Sep 2025 11:49:53 +0000 (13:49 +0200)
committerTobias Brunner <tobias@strongswan.org>
Tue, 30 Sep 2025 09:26:41 +0000 (11:26 +0200)
src/frontends/android/app/src/main/java/org/strongswan/android/ui/adapter/VpnProfileAdapter.java

index c2942b8a1858ce6dc423e8e8f0b6896e2cb6e2f9..097c422a1daa253271ed4cf14678e01d4f76bfc3 100644 (file)
@@ -86,7 +86,8 @@ public class VpnProfileAdapter extends ArrayAdapter<VpnProfile>
                tv = vpnProfileView.findViewById(R.id.profile_item_certificate);
                if (profile.getVpnType().has(VpnTypeFeature.CERTIFICATE))
                {
-                       tv.setText(getContext().getString(R.string.profile_user_certificate_label) + ": " + profile.getUserCertificateAlias());
+                       String alias = profile.getUserCertificateAlias();
+                       tv.setText(getContext().getString(R.string.profile_user_certificate_label) + ": " + (alias != null ? alias : ""));
                        tv.setVisibility(View.VISIBLE);
                }
                else