Fix frontend error when car is not moving yet

This commit is contained in:
David Eder 2021-06-15 18:14:26 +02:00
parent d6a44ac1f6
commit 5742d184f2

View File

@ -55,6 +55,9 @@ export class LandingComponent implements OnInit {
startWith(0), startWith(0),
switchMap(() => this.restService.getCarEvents(vin)) switchMap(() => this.restService.getCarEvents(vin))
).subscribe((data: any) => { ).subscribe((data: any) => {
if (data.body === '') {
return;
}
const carEvent = data.body as CarEvent; const carEvent = data.body as CarEvent;
const car = this.car_markers.get(vin) as Car; const car = this.car_markers.get(vin) as Car;
car.carEvent = carEvent; car.carEvent = carEvent;