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

Not call whenInactive when it is null #48

Merged
merged 1 commit into from
Mar 5, 2023
Merged

Not call whenInactive when it is null #48

merged 1 commit into from
Mar 5, 2023

Conversation

kafkiansky
Copy link
Contributor

Corrected the whenInactive closure call in the when method, so that it is called when not null.

@driesvints
Copy link
Member

driesvints commented Mar 3, 2023

As you can see from the docblock, $whenInactive can never be null. Make sure it's valid before passing it to this method.

@driesvints driesvints closed this Mar 3, 2023
@kafkiansky
Copy link
Contributor Author

As you can see from the docblock, $whenInactive can never be null. Make sure it's valid before passing it to this method.

Seriously? https://github.com/laravel/pennant/blob/1.x/src/PendingScopedFeatureInteraction.php#L202

@kafkiansky
Copy link
Contributor Author

It also null by default https://github.com/laravel/pennant/blob/1.x/src/PendingScopedFeatureInteraction.php#L205. What if I don't have to do anything if the feature isn't active?

@timacdonald timacdonald reopened this Mar 5, 2023
@timacdonald
Copy link
Member

This is a bug and I've written a failing test for it to prove it is problematic.

I can't push the test to the branch as it no longer exists. Gonna merge and push the test after.

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