Fix panic in vehicle selection
This commit is contained in:
parent
329bbc5d5b
commit
f5913956b6
1 changed files with 3 additions and 2 deletions
|
|
@ -356,12 +356,13 @@ func vehicleHandler(site site.API, loadpoint loadpoint.API) http.HandlerFunc {
|
|||
return
|
||||
}
|
||||
|
||||
loadpoint.SetVehicle(vehicles[val-1])
|
||||
v := vehicles[val-1]
|
||||
loadpoint.SetVehicle(v)
|
||||
|
||||
res := struct {
|
||||
Vehicle string `json:"vehicle"`
|
||||
}{
|
||||
Vehicle: vehicles[val].Title(),
|
||||
Vehicle: v.Title(),
|
||||
}
|
||||
|
||||
jsonResult(w, res)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue