From f8d0878003ab6d0329bc39a06bb6f468dd9a8754 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Fri, 21 Apr 2017 10:31:58 +0100 Subject: [PATCH] Journal sharing: Add a nice error message when journal is not found. --- .../java/com/etesync/syncadapter/ui/AddMemberFragment.java | 6 +++++- app/src/main/res/values/strings.xml | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/etesync/syncadapter/ui/AddMemberFragment.java b/app/src/main/java/com/etesync/syncadapter/ui/AddMemberFragment.java index a2f52178..dae2ba6c 100644 --- a/app/src/main/java/com/etesync/syncadapter/ui/AddMemberFragment.java +++ b/app/src/main/java/com/etesync/syncadapter/ui/AddMemberFragment.java @@ -82,7 +82,11 @@ public class AddMemberFragment extends DialogFragment { try { UserInfoManager userInfoManager = new UserInfoManager(httpClient, remote); - memberPubKey = userInfoManager.get(memberEmail).getPubkey(); + UserInfoManager.UserInfo userInfo = userInfoManager.get(memberEmail); + if (userInfo == null) { + throw new Exception(getString(R.string.collection_members_error_user_not_found, memberEmail)); + } + memberPubKey = userInfo.getPubkey(); return new AddResult(null); } catch (Exception e) { return new AddResult(e); diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 815a70c2..a061b759 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -119,6 +119,7 @@ Adding member Verify security fingerprint Verify %s\'s security fingerprint to ensure the encryption is secure. + User (%s) not found, or has journal sharing disabled. Removing member Error removing member Remove member