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

fix: replace try...catch(BadMethodCallException) blocks with a method_exists() condition #155

Merged
merged 1 commit into from
Oct 24, 2024
Merged

fix: replace try...catch(BadMethodCallException) blocks with a method_exists() condition #155

merged 1 commit into from
Oct 24, 2024

Conversation

Yogarine
Copy link
Collaborator

Using BadMethodCallException in this way is not recommended because it may obfuscate underlying issues in the code.

And specifically for me, the call to the non-existent withTrashed() triggers a rare PHP bug which results in a Segmentation fault under very specific and rare circumstances. 🙃

…hod_exists()` condition

Using BadMethodCallException in this way is not recommended because it may obfuscate underlying issues in the code.
@gcphost gcphost merged commit c279c66 into Askedio:master Oct 24, 2024
1 of 13 checks passed
@gcphost
Copy link
Contributor

gcphost commented Oct 24, 2024

Sorry had to revert, the tests failed.

@Yogarine
Copy link
Collaborator Author

Ah I see, withThrashed() is forwarded through a magic __call() method. method_exist() wont work in that case. I'll go back to the drawing board.

I'll also make sure to actually properly run tests myself next time. 😅 Sorry 'bout that.

@Yogarine
Copy link
Collaborator Author

Here's the proper fix:

#157

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