chore: fix panic

This commit is contained in:
andig 2025-11-07 16:16:56 +01:00
parent f4910d284b
commit 0760db8d4b

View file

@ -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(),