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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

jyrkidn
Copy link

@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.

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.

1 participant