fix errore user.id can be undefined

This commit is contained in:
tito
2023-05-06 16:50:23 +02:00
parent bd6a38840f
commit 5a2cd0e3a0

View File

@@ -94,7 +94,7 @@ export class DetailComponent implements OnInit {
// implement this nex line in angular ts
this.myModal.nativeElement.checked = true;
this.userService.getUser("tito").subscribe(user => {
if (user.id !== undefined) {
if (user?.id !== undefined) {
let waypointVisited: WaypointsVisitedEntity = {userId: user.id , waypointId: this.waypointInfo.id}
console.log("waypointVisited", waypointVisited)
this.waypointVisitedService.createWaypoint(waypointVisited)