Skip to content

Commit

Permalink
Merge pull request #6 from Lenart12/dev
Browse files Browse the repository at this point in the history
Fix crash on vehicle not found (#5)
  • Loading branch information
Lenart12 authored Feb 9, 2025
2 parents 74a17cf + de58b3a commit 658feb5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,11 @@ func publishState(ctx context.Context, vin string, http_client *http.Client, mqt
state, err := getState(ctx, vin, http_client, disc.Discovery.DeviceType, &disc.PublishBindings)
// log.Debug("Got state", "state", state)

// Create state map if it doesn't exist
if state == nil {
state = make(map[string]string)
}

// If the context is done, return
if err != nil && ctx.Err() != nil {
return ctx.Err()
Expand Down

0 comments on commit 658feb5

Please sign in to comment.