So I had a function in Angular named appUser$, the error said "Cannot destructure property 'uid' of 'object null' as it is null."
get appUser$(): Observable<AppUser> {
return this.user$.pipe(
switchMap(({uid})=> this.userService.get(uid)));
}
Then I changed it to:
get appUser$(): Observable<AppUser> {
return this.user$.pipe(
switchMap(({uid})=> {
if({uid}){
return this.userService.get(uid);
} else {
return of(null);
}
}));
}
But still it doesnt work, any ideas?