Skip to content

Fixes AB#3553684 Fix NPE in PackageHelper.isPackageInstalledAndEnable… - #3053

Merged
Siddhi (siddhijain) merged 1 commit into
working/release/24.1.0from
cherry-pick/package-helper-npe-fix-24.1.0
Mar 24, 2026
Merged

Fixes AB#3553684 Fix NPE in PackageHelper.isPackageInstalledAndEnable…#3053
Siddhi (siddhijain) merged 1 commit into
working/release/24.1.0from
cherry-pick/package-helper-npe-fix-24.1.0

Conversation

@siddhijain

Copy link
Copy Markdown
Contributor

…d (#3051)

Fixes
AB#3553684 When getApplicationInfo throws NameNotFoundException for an uninstalled package, the catch block logged the error but did not return. Execution fell through to code that could dereference applicationInfo.enabled, causing a NullPointerException.

Return false immediately in the NameNotFoundException catch block so the method exits cleanly when the queried package is not installed.

#3051)

Fixes
[AB#3553684](https://identitydivision.visualstudio.com/fac9d424-53d2-45c0-91b5-ef6ba7a6bf26/_workitems/edit/3553684)
When getApplicationInfo throws NameNotFoundException for an uninstalled
package, the catch block logged the error but did not return. Execution
fell through to code that could dereference applicationInfo.enabled,
causing a NullPointerException.

Return false immediately in the NameNotFoundException catch block so the
method exits cleanly when the queried package is not installed.
@siddhijain
Siddhi (siddhijain) requested a review from a team as a code owner March 24, 2026 16:09
@siddhijain
Siddhi (siddhijain) merged commit 06ccc6f into working/release/24.1.0 Mar 24, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants