Skip to content

Commit e9128f5

Browse files
authored
fix(package): error in ngx-auth-firebaseui-avatar
Currently, `<ngx-auth-firebaseui-avatar />` throws an error if there is no current user, e.g.: ``` core.js:7187 ERROR TypeError: Cannot read property 'displayName' of null at SafeSubscriber._next (ngx-auth-firebaseui.js:1793) at SafeSubscriber.__tryOrUnsub (Subscriber.js:183) at SafeSubscriber.next (Subscriber.js:122) at Subscriber._next (Subscriber.js:72) at Subscriber.next (Subscriber.js:49) at angularfire2.js:44 at ZoneDelegate.invoke (zone-evergreen.js:359) at Object.onInvoke (core.js:30892) at ZoneDelegate.invoke (zone-evergreen.js:358) at Zone.run (zone-evergreen.js:124) ```
1 parent 2287e70 commit e9128f5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/module/components/ngx-auth-firebaseui-avatar/ngx-auth-firebaseui-avatar.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export class NgxAuthFirebaseuiAvatarComponent implements OnInit {
3939
this.user$ = this.afa.user;
4040
this.user$.subscribe((user: User) => {
4141
this.user = user;
42-
this.displayNameInitials = this.getDisplayNameInitials(user.displayName);
42+
this.displayNameInitials = user ? this.getDisplayNameInitials(user.displayName) : null;
4343
});
4444
}
4545

0 commit comments

Comments
 (0)