-
Notifications
You must be signed in to change notification settings - Fork 25.8k
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(router): throw an error when navigate to null/undefined path #13384
Conversation
@@ -558,6 +559,15 @@ export class Router { | |||
} | |||
} | |||
|
|||
private validateCommands(commands: string[]): void { | |||
for (let i = 0; i < commands.length; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commands.forEach(cmd, i => ...
`... contains ${cmd} at index ${i}...`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
forEach
skips undefined elements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah right it would skip holes... (but not undefined els) I guess a for
is better then.
@@ -558,6 +559,15 @@ export class Router { | |||
} | |||
} | |||
|
|||
private validateCommands(commands: string[]): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make a function outside of the class. Thanks
946b86b
to
9165d39
Compare
9165d39
to
610b7ac
Compare
610b7ac
to
b12efa1
Compare
The v4 commit is 46cb04d |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Closes #10560