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

bugfix: return false when the route is undefined #26

Closed
wants to merge 1 commit into from
Closed

bugfix: return false when the route is undefined #26

wants to merge 1 commit into from

Conversation

Chun-Yang
Copy link

When the current route is undefined, we return false for ActiveRoute.name.

The current route may be undefined because the router is not ready yet.

@zimme
Copy link
Collaborator

zimme commented Jun 4, 2015

In the current code, version zimme:[email protected], ActiveRoute.name should already be returning false if the router isn't ready yet.

I can't reproduce ActiveRoute.name returning something other then false when a Router isn't ready/Router.current() is undefined

I however saw that I'd missed a guard of the controller in ActiveRoute.path

@zimme
Copy link
Collaborator

zimme commented Jun 4, 2015

or did you mean ActiveRoute.name(undefined) maybe?

@@ -62,7 +62,7 @@ ActiveRoute =
if fr
currentRouteName ?= fr.FlowRouter.getRouteName()

test currentRouteName, routeName
currentrouteName and test(currentRouteName, routeName)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo, should be currentRouteName, uppercase R

@Chun-Yang
Copy link
Author

currentRouteName is undefined sometime in my app, there might be a race condition. I am using Iron Router.

Now I changed test to guard value.

Is that appropriate?

@zimme zimme closed this in db5c3fe Jun 4, 2015
@zimme
Copy link
Collaborator

zimme commented Jun 4, 2015

So I was able to reproduce it, and because I made some other changes too I didn't use this PR.

Thank you, I appreciate the help very much.

I'll be publishing the new version within the hour. 👍

@zimme zimme added the bug label Jun 6, 2015
zimme added a commit that referenced this pull request Jul 8, 2015
Return false if current route name or path is undefined.
i.e. route controller isn’t ready.

Fixes #26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants