From 5742d184f2678e82a9b8945df5b63b675678e596 Mon Sep 17 00:00:00 2001 From: David Eder Date: Tue, 15 Jun 2021 18:14:26 +0200 Subject: [PATCH] Fix frontend error when car is not moving yet --- .../src/app/component/landing/landing.component.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/control_center/src/app/component/landing/landing.component.ts b/components/control_center/src/app/component/landing/landing.component.ts index 1c67bb4..bb4cf64 100644 --- a/components/control_center/src/app/component/landing/landing.component.ts +++ b/components/control_center/src/app/component/landing/landing.component.ts @@ -55,6 +55,9 @@ export class LandingComponent implements OnInit { startWith(0), switchMap(() => this.restService.getCarEvents(vin)) ).subscribe((data: any) => { + if (data.body === '') { + return; + } const carEvent = data.body as CarEvent; const car = this.car_markers.get(vin) as Car; car.carEvent = carEvent;