Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException from AccountManagerUtil.java #1617

Open
jiayle27 opened this issue Nov 2, 2021 · 1 comment
Open

NullPointerException from AccountManagerUtil.java #1617

jiayle27 opened this issue Nov 2, 2021 · 1 comment
Labels
Issue Triage The engineering team has looked into the issue, understood the issue, labelled/classified the issue

Comments

@jiayle27
Copy link

jiayle27 commented Nov 2, 2021

Issue
Telemetry shows MSAL related crash for extremely small size of users (0.0006% total users) but high hit rate for these impacted users. All affected OS is Android 11, devices are mostly Pixel 5.

Crash
com.microsoft.identity.common.internal.util.AccountManagerUtil.canUseAccountManagerOperation
AccountManagerUtil.java, line 62
java.lang.NullPointerException: Attempt to get length of null array

Version
commonVersion=3.6.2
msalVersion=2.2.1

Stack traces
com.microsoft.identity.common.internal.util.AccountManagerUtil.canUseAccountManagerOperation AccountManagerUtil.java:62
com.microsoft.identity.common.internal.controllers.BrokerMsalController.getIpcStrategies BrokerMsalController.java:160
com.microsoft.identity.common.internal.controllers.BrokerMsalController. BrokerMsalController.java:124
com.microsoft.identity.client.internal.controllers.MSALControllerFactory.getDefaultController MSALControllerFactory.java:73
com.microsoft.identity.client.PublicClientApplication.create PublicClientApplication.java:917
com.microsoft.identity.client.PublicClientApplication.createMultipleAccountPublicClientApplication PublicClientApplication.java:980
com.microsoft.identity.client.PublicClientApplication.access$100 PublicClientApplication.java:202
com.microsoft.identity.client.PublicClientApplication$4.run PublicClientApplication.java:458
java.lang.Thread.run Thread.java:923

@AdamBJohnsonx
Copy link
Contributor

AdamBJohnsonx commented Nov 2, 2021

https://developer.android.com/reference/android/app/admin/DevicePolicyManager#getAccountTypesWithManagementDisabled()

This is a bug. The api may return null, and we're not checking for it here:

for (final String accountType : devicePolicyManager.getAccountTypesWithManagementDisabled()) {

@gitaumoses4 gitaumoses4 added the Issue Triage The engineering team has looked into the issue, understood the issue, labelled/classified the issue label Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue Triage The engineering team has looked into the issue, understood the issue, labelled/classified the issue
Projects
None yet
Development

No branches or pull requests

3 participants