diff --git a/dmp-frontend/src/app/app.component.ts b/dmp-frontend/src/app/app.component.ts index 7fd33fb2d..cde53ffed 100644 --- a/dmp-frontend/src/app/app.component.ts +++ b/dmp-frontend/src/app/app.component.ts @@ -91,11 +91,13 @@ export class AppComponent implements OnInit { filter(event => event instanceof NavigationEnd), map(() => { let child = this.route.firstChild; - while (child.firstChild) { - child = child.firstChild; - } - if (child.snapshot.data['title']) { - return child.snapshot.data['title']; + if (child != null) { + while (child.firstChild) { + child = child.firstChild; + } + if (child.snapshot.data['title']) { + return child.snapshot.data['title']; + } } return appTitle; })