From 7b38bfcbf4a0efba3cece382c4f30e52d08f4a37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Wed, 29 Jan 2014 03:58:36 +0100 Subject: [PATCH] show unknown in ViewKey if user id is not set --- .../sufficientlysecure/keychain/ui/ViewKeyActivity.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java index d8cd1c672..502fca7e7 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java @@ -301,8 +301,13 @@ public class ViewKeyActivity extends SherlockFragmentActivity implements // get name, email, and comment from USER_ID String[] mainUserId = PgpKeyHelper.splitUserId(data .getString(KEYRING_INDEX_USER_ID)); - setTitle(mainUserId[0]); - mName.setText(mainUserId[0]); + if (mainUserId[0] != null && mainUserId[0].length() > 0) { + setTitle(mainUserId[0]); + mName.setText(mainUserId[0]); + } else { + setTitle(R.string.unknown_user_id); + mName.setText(R.string.unknown_user_id); + } mEmail.setText(mainUserId[1]); mComment.setText(mainUserId[2]); }