6
1
mirror of https://git.mills.io/saltyim/saltyim.git synced 2024-06-27 09:18:22 +00:00

Fix possible nil map from State.Load()

This commit is contained in:
James Mills 2022-10-05 13:21:32 +10:00
parent 7c149128b4
commit 37135ce6af
No known key found for this signature in database
GPG Key ID: AC4C014F1440EBD6

@ -77,5 +77,9 @@ func LoadState(r io.Reader) (*State, error) {
return nil, fmt.Errorf("error reading state: %w", err)
}
if state.Indicies == nil {
state.Indicies = make(map[string]int64)
}
return state, nil
}