-
Notifications
You must be signed in to change notification settings - Fork 18
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
It returns null when the url is an empty string #37
Comments
Thanks for reporting this! Sorry for the delay in replying. I'll look into this in the new year. In the meantime, feel free to send a pull request if you resolve the issue :) |
Just getting back into things now. Is an empty string really a valid URL? Wouldn't it be |
Hi Daniel, I have the following controller
but when I call Router.action("Home", "Index") in my js files I get some exception, although the route does exist in the list of registered routes as "{"route":{"url":"","defaults":{"controller":"Home","action":"Index"},"constraints":{},"optional":[]},"_params":[],"_parsedConstraints":{}}" I did some debugging and the problem seems to be here:
When finalUrl is "", that is evaluated by !finalUrl as a truish value, returning null. I think it could be fixed if finalUrl is checked against null directly. |
Good catch, thanks! I'll try to take a look soon. |
An empty string is a valid url resolvable from a route. However when finalUrl is an empty string, it returns null and it should return the empty string.
The text was updated successfully, but these errors were encountered: