DriveSomethingGreater: gracefully handle empty vehicles

This commit is contained in:
andig 2026-06-24 11:01:13 +02:00
parent 1b08a3461e
commit b715251e28

View file

@ -268,7 +268,7 @@ func (v *API) Vehicles() ([]Vehicle, error) {
// the response is either a bare array or wrapped in {"vehicles": [...]}
var arr []Vehicle
if err := json.Unmarshal(b, &arr); err == nil && len(arr) > 0 {
if err := json.Unmarshal(b, &arr); err == nil && len(b) > 0 {
return arr, nil
}