From d1c1b88926c616568ca4e91571ce187cad0ce4c4 Mon Sep 17 00:00:00 2001 From: Dome Pongmongkol <19558668+rpdome@users.noreply.github.com> Date: Tue, 7 Nov 2023 13:52:34 -0600 Subject: [PATCH] bring back null check (#1940) Undo the removal in https://github.com/AzureAD/microsoft-authentication-library-for-android/pull/1933 - as there is a chance that this is a separate issue. --- .../java/com/microsoft/identity/client/AccountAdapter.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/msal/src/main/java/com/microsoft/identity/client/AccountAdapter.java b/msal/src/main/java/com/microsoft/identity/client/AccountAdapter.java index 3b23e9858..9a6faa421 100644 --- a/msal/src/main/java/com/microsoft/identity/client/AccountAdapter.java +++ b/msal/src/main/java/com/microsoft/identity/client/AccountAdapter.java @@ -60,7 +60,9 @@ public List filter(@NonNull List records) { final String acctHomeAccountId = cacheRecord.getAccount().getHomeAccountId(); final String acctLocalAccountId = cacheRecord.getAccount().getLocalAccountId(); - if (!acctHomeAccountId.contains(acctLocalAccountId)) { + // TODO: check the logic on broker side to make sure this value is NOT null. + if (acctLocalAccountId != null && + !acctHomeAccountId.contains(acctLocalAccountId)) { result.add(cacheRecord); } }