Fixed error ''Cannot read property 'firstChild' of null'' after Login

This commit is contained in:
gpapavgeri 2020-08-27 17:38:07 +03:00
parent 3d9b30567d
commit 7a6228b136
1 changed files with 7 additions and 5 deletions

View File

@ -91,12 +91,14 @@ export class AppComponent implements OnInit {
filter(event => event instanceof NavigationEnd), filter(event => event instanceof NavigationEnd),
map(() => { map(() => {
let child = this.route.firstChild; let child = this.route.firstChild;
if (child != null) {
while (child.firstChild) { while (child.firstChild) {
child = child.firstChild; child = child.firstChild;
} }
if (child.snapshot.data['title']) { if (child.snapshot.data['title']) {
return child.snapshot.data['title']; return child.snapshot.data['title'];
} }
}
return appTitle; return appTitle;
}) })
).subscribe((ttl: string) => { ).subscribe((ttl: string) => {