Skip to content

Commit

Permalink
fix(route styles): sometimes there is no 'to' in a route, and so we n…
Browse files Browse the repository at this point in the history
…eed to gaurd against that. fixes #323
  • Loading branch information
webark committed Jun 22, 2019
1 parent 9ef78f7 commit 157388d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions addon/instance-initializers/route-styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ export function initialize(appInstance) {
});
}

function nestedRouteNames(route, routeNames = []) {
routeNames.push(route.name);
function nestedRouteNames(route = {}, routeNames = []) {
if (route.name) {
routeNames.push(route.name);
}

if (route.parent) {
return nestedRouteNames(route.parent, routeNames);
}
Expand Down

0 comments on commit 157388d

Please sign in to comment.