Skip to content

Commit 157388d

Browse files
committed
fix(route styles): sometimes there is no 'to' in a route, and so we need to gaurd against that. fixes #323
1 parent 9ef78f7 commit 157388d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

addon/instance-initializers/route-styles.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@ export function initialize(appInstance) {
1818
});
1919
}
2020

21-
function nestedRouteNames(route, routeNames = []) {
22-
routeNames.push(route.name);
21+
function nestedRouteNames(route = {}, routeNames = []) {
22+
if (route.name) {
23+
routeNames.push(route.name);
24+
}
25+
2326
if (route.parent) {
2427
return nestedRouteNames(route.parent, routeNames);
2528
}

0 commit comments

Comments
 (0)