From 86f68cf04f5166848fd44150363866d7faa72b60 Mon Sep 17 00:00:00 2001 From: Janos Guljas Date: Thu, 27 Sep 2018 10:08:57 +0200 Subject: cmd/swarm: fail on SWARM_ENV_MAX_STREAM_PEER_SERVERS parsing error --- cmd/swarm/config.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'cmd') diff --git a/cmd/swarm/config.go b/cmd/swarm/config.go index 00978ba26..9d6fe41a7 100644 --- a/cmd/swarm/config.go +++ b/cmd/swarm/config.go @@ -313,9 +313,11 @@ func envVarsOverride(currentConfig *bzzapi.Config) (config *bzzapi.Config) { } if max := os.Getenv(SWARM_ENV_MAX_STREAM_PEER_SERVERS); max != "" { - if m, err := strconv.Atoi(max); err == nil { - currentConfig.MaxStreamPeerServers = m + m, err := strconv.Atoi(max) + if err != nil { + utils.Fatalf("invalid environment variable %s: %v", SWARM_ENV_MAX_STREAM_PEER_SERVERS, err) } + currentConfig.MaxStreamPeerServers = m } if lne := os.Getenv(SWARM_ENV_LIGHT_NODE_ENABLE); lne != "" { -- cgit v1.2.3