fix(statusd)_: fix panic on nil conversion to interface

Fixes #5371
This commit is contained in:
Ivan Belyakov 2024-06-18 18:09:25 +02:00 committed by IvanBelyakoff
parent b2a184ea78
commit b0d103d494
1 changed files with 2 additions and 3 deletions

View File

@ -926,14 +926,13 @@ func (o *Manager) checkConnectionStatus(chainID walletCommon.ChainID) {
// If no chain in statuses, add it
statusVal, ok := o.statuses.Load(chainID.String())
status := statusVal.(*connection.Status)
if !ok {
status = connection.NewStatus()
status := connection.NewStatus()
status.SetIsConnected(false)
o.statuses.Store(chainID.String(), status)
o.updateStatusNotifier()
} else {
status.SetIsConnected(false)
statusVal.(*connection.Status).SetIsConnected(false)
}
}