mirror of
https://github.com/status-im/status-go.git
synced 2025-02-16 16:56:53 +00:00
Check that server is nil before calling peers count
On logout happens sometimes that `PeersCount` is called when the server has been removed. This commit adds a guard to make sure that the server is not nil when calling `PeersCount`.
This commit is contained in:
parent
9dffff042e
commit
3f63b0c23c
@ -101,5 +101,8 @@ func (w *gethNodeWrapper) RemovePeer(url string) error {
|
||||
}
|
||||
|
||||
func (w *gethNodeWrapper) PeersCount() int {
|
||||
if w.stack.Server() == nil {
|
||||
return 0
|
||||
}
|
||||
return len(w.stack.Server().Peers())
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user