Fixed error ''Cannot read property 'firstChild' of null'' after Login
This commit is contained in:
parent
3d9b30567d
commit
7a6228b136
|
@ -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;
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue