diff --git a/adal/src/main/java/com/microsoft/aad/adal/TokenCacheAccessor.java b/adal/src/main/java/com/microsoft/aad/adal/TokenCacheAccessor.java index 8e85d5d6f..06fcb2982 100644 --- a/adal/src/main/java/com/microsoft/aad/adal/TokenCacheAccessor.java +++ b/adal/src/main/java/com/microsoft/aad/adal/TokenCacheAccessor.java @@ -437,8 +437,12 @@ boolean isMultipleMRRTsMatchingGivenApp(final String clientId) { final List mrrtsMatchingRequest = new ArrayList<>(); while (allItems.hasNext()) { final TokenCacheItem tokenCacheItem = allItems.next(); - if (tokenCacheItem.getAuthority().equalsIgnoreCase(mAuthority) && tokenCacheItem.getClientId().equalsIgnoreCase(clientId) - && (tokenCacheItem.getIsMultiResourceRefreshToken() || StringExtensions.isNullOrBlank(tokenCacheItem.getResource()))) { + if (tokenCacheItem!=null && tokenCacheItem.getAuthority()!=null && + tokenCacheItem.getAuthority().equalsIgnoreCase(mAuthority) && + tokenCacheItem.getClientId()!=null && + tokenCacheItem.getClientId().equalsIgnoreCase(clientId) && + (tokenCacheItem.getIsMultiResourceRefreshToken() || + StringExtensions.isNullOrBlank(tokenCacheItem.getResource()))) { mrrtsMatchingRequest.add(tokenCacheItem); } }