mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-08 15:36:12 +00:00
Small improvement
This commit is contained in:
parent
271f900b86
commit
89d6969937
1 changed files with 9 additions and 2 deletions
|
@ -176,8 +176,15 @@ public class ActivityError extends ActivityBase {
|
|||
long account = args.getLong("account");
|
||||
|
||||
DB db = DB.getInstance(context);
|
||||
List<EntityIdentity> identities = db.identity().getSynchronizingIdentities(account);
|
||||
return (identities == null || identities.size() != 1 ? null : identities.get(0));
|
||||
List<EntityIdentity> identities = db.identity().getIdentities(account);
|
||||
if (identities == null)
|
||||
return null;
|
||||
if (identities.size() == 1)
|
||||
return identities.get(0);
|
||||
for (EntityIdentity identity : identities)
|
||||
if (identity.primary)
|
||||
return identity;
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue