From 50c4c5116d1158c190e79ccd27d2e231b7b5b312 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 29 Sep 2021 12:25:36 +0300 Subject: [PATCH] [#863] node: Prevent panic about missing Neo RPC endpoints Signed-off-by: Leonard Lyubich --- cmd/neofs-node/morph.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/neofs-node/morph.go b/cmd/neofs-node/morph.go index 6debe5016a..94fe28f5a1 100644 --- a/cmd/neofs-node/morph.go +++ b/cmd/neofs-node/morph.go @@ -37,6 +37,10 @@ func initMorphComponents(c *cfg) { var err error fn := func(addresses []string, dialTimeout time.Duration, handler func(*client.Client)) { + if len(addresses) == 0 { + fatalOnErr(errors.New("missing Neo RPC endpoints")) + } + crand := rand.New() // math/rand with cryptographic source crand.Shuffle(len(addresses), func(i, j int) { addresses[i], addresses[j] = addresses[j], addresses[i]