From 0760db8d4bc51e1c50a801a9c88e9bcbdffbd984 Mon Sep 17 00:00:00 2001 From: andig Date: Fri, 7 Nov 2025 16:16:56 +0100 Subject: [PATCH] chore: fix panic --- core/site_vehicles.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/core/site_vehicles.go b/core/site_vehicles.go index ae79d7c14..a2e88fda8 100644 --- a/core/site_vehicles.go +++ b/core/site_vehicles.go @@ -39,15 +39,18 @@ func (site *Site) publishVehicles() { res := make(map[string]vehicleStruct, len(vv)) for _, v := range vv { - var plan *planStruct + instance := v.Instance() + if instance == nil { + continue + } + ac := instance.OnIdentified() + + var plan *planStruct if time, precondition, soc := v.GetPlanSoc(); !time.IsZero() { plan = &planStruct{Soc: soc, Precondition: int64(precondition.Seconds()), Time: time} } - instance := v.Instance() - ac := instance.OnIdentified() - res[v.Name()] = vehicleStruct{ Title: instance.GetTitle(), Icon: instance.Icon(),