chore: fix panic
This commit is contained in:
parent
f4910d284b
commit
0760db8d4b
1 changed files with 7 additions and 4 deletions
|
|
@ -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(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue