From 3f63b0c23cbe32c2331cb6201ee5cb5255ce9353 Mon Sep 17 00:00:00 2001 From: Andrea Maria Piana Date: Mon, 2 Nov 2020 16:50:05 +0100 Subject: [PATCH] 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`. --- VERSION | 2 +- eth-node/bridge/geth/node.go | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 8658d811d..9a5c71c0a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.62.17 +0.62.18 diff --git a/eth-node/bridge/geth/node.go b/eth-node/bridge/geth/node.go index fe89734eb..ef4e7ca67 100644 --- a/eth-node/bridge/geth/node.go +++ b/eth-node/bridge/geth/node.go @@ -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()) }