mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 19:29:06 +01:00
Address review comments for detecting duplicate (pending) contacts
This commit is contained in:
@@ -120,8 +120,10 @@ public class NicknameFragment extends BaseFragment {
|
||||
|
||||
viewModel.getAddContactResult().observe(this, result -> {
|
||||
if (result == null) return;
|
||||
if (result.hasError()) handleException(name, result.getException());
|
||||
else showPendingContactListActivity();
|
||||
if (result.hasError())
|
||||
handleException(name, requireNonNull(result.getException()));
|
||||
else
|
||||
showPendingContactListActivity();
|
||||
});
|
||||
viewModel.addContact(name);
|
||||
}
|
||||
@@ -133,7 +135,7 @@ public class NicknameFragment extends BaseFragment {
|
||||
finish();
|
||||
}
|
||||
|
||||
private void handleException(String name, @Nullable Exception e) {
|
||||
private void handleException(String name, Exception e) {
|
||||
if (e instanceof ContactExistsException) {
|
||||
ContactExistsException ce = (ContactExistsException) e;
|
||||
handleExistingContact(name, ce.getRemoteAuthor());
|
||||
|
||||
Reference in New Issue
Block a user