Skip to content
This repository was archived by the owner on Mar 13, 2018. It is now read-only.

Fix uncaught TypeError when this.route is null#37

Open
adalinesimonian wants to merge 2 commits intogooglearchive:masterfrom
adalinesimonian:patch-1
Open

Fix uncaught TypeError when this.route is null#37
adalinesimonian wants to merge 2 commits intogooglearchive:masterfrom
adalinesimonian:patch-1

Conversation

@adalinesimonian
Copy link
Copy Markdown

If this.route is null, trying to dereference this.route.fullPath leads to an uncaught TypeError. This error can be easily found when trying to programmatically create an instance of <more-route> when it has no parent, as the preconditions in _identityChanged for setting this.route to null are only that this.name and this.path are both falsy, which is true when the element has just been created with document.createElement('more-route').

Local test results after patch:

Starting Selenium server for local browsers
Selenium server running on port 50417
Web server running on port 50425 and serving from /Users/vartan/Documents/webcomponent-dev/polymer-0.9.x/more-routing
chrome 42                Beginning tests via http://localhost:50425/components/more-routing/generated-index.html?cli_browser_id=0
safari 8.0.6             Beginning tests via http://localhost:50425/components/more-routing/generated-index.html?cli_browser_id=2
chrome 42                Tests passed
safari 8.0.6             Tests passed
firefox 37               Beginning tests via http://localhost:50425/components/more-routing/generated-index.html?cli_browser_id=1
firefox 37               Tests passed
Test run ended with great success

chrome 42 (3/0/0)                       firefox 37 (3/0/0)                    
safari 8.0.6 (3/0/0)  

@adalinesimonian adalinesimonian changed the title Fix TypeError bug when this.route is null Fix uncaught TypeError when this.route is null May 19, 2015
Merge with update to Polymer 1.0
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant