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 error calling 'current()' on an unknown route #362

Merged
merged 3 commits into from
Nov 13, 2020

Conversation

bakerkretzmar
Copy link
Collaborator

After this PR, instead of causing an error, calling route().current() on an unknown route (e.g. a route without a name) now returns undefined, and passing an invalid route name, for example route().current('this-route-name-doesnt-exist'), returns false.

Fixes #360.

@bakerkretzmar bakerkretzmar merged commit e2a9914 into main Nov 13, 2020
@bakerkretzmar bakerkretzmar deleted the jbk/current-unknown-route-bug branch November 13, 2020 21:36
@d13r
Copy link
Contributor

d13r commented Nov 14, 2020

Thanks for the quick fix. 👍

@dbcreator-studios
Copy link

route().current() still return undefined in latest version

@bakerkretzmar
Copy link
Collaborator Author

@dbcreator-studios if you call route().current() on an unnamed or unknown route, returning undefined is the expected behaviour.

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.

Error in route().current() when on 404 page
3 participants