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

Fixed possible Nullpointexception when checking subscription status in Java #608

Merged

Conversation

Jethro87
Copy link
Contributor

Motivation / Description

We now check whether the entitlement exists before accessing .isActive().

Old

if (customerInfo.getEntitlements().get(<your_entitlement_id>).isActive()) {
	// user has access to "your_entitlement_id"
}

New

if (customerInfo.getEntitlements().get(<your_entitlement_id>) != null
    && customerInfo.getEntitlements().get(<your_entitlement_id>).isActive()) {
	// user has access to "your_entitlement_id"
}

@Jethro87 Jethro87 requested a review from a team as a code owner January 22, 2025 16:19
Copy link

Preview this PR here: https://dev-docs.revenuecat.com/pr-608/

@HaleyRevcat HaleyRevcat merged commit 466fd0f into main Jan 22, 2025
4 checks passed
@HaleyRevcat HaleyRevcat deleted the jeff/fix-java-subscription-status-null-pointer-exception branch January 22, 2025 16:56
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.

2 participants