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

Make route getName optional #101

Merged
merged 1 commit into from
Nov 21, 2024
Merged

Conversation

jyrkidn
Copy link
Contributor

@jyrkidn jyrkidn commented Jun 19, 2024

Since 404 routes return null this breaks calling getName(). Adding ? fixes this

Since 404 routes return `null` this breaks calling `getName()`
Copy link

what-the-diff bot commented Jun 19, 2024

PR Summary

  • Improved handling of route name retrivals
    The code in the LanguageSwitch.php file, specifically in the isVisibleOutsidePanels method, has been updated to retrieve the name of a route in a safer way. It now uses an updated syntax request()->route()?->getName(), ensuring the application avoids potential errors when trying to access the name of a route that might not exist. The updated code provides enhanced stability and reduces the chance of unexpected crashes.

@bezhanSalleh bezhanSalleh merged commit 8f91b80 into bezhanSalleh:main Nov 21, 2024
1 check passed
@bezhanSalleh
Copy link
Owner

Thanks

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