Fix nil pointer dereference in `main.startCollectingStats`

This commit is contained in:
Pedro Pombeiro 2018-02-22 17:51:19 +01:00
parent 134d01fcc1
commit b8eaffb0f6
No known key found for this signature in database
GPG Key ID: A65DEB11E4BBC647
1 changed files with 4 additions and 2 deletions

View File

@ -173,9 +173,11 @@ func startCollectingStats(interruptCh <-chan struct{}, nodeManager common.NodeMa
<-interruptCh <-interruptCh
if server != nil {
if err := server.Shutdown(context.TODO()); err != nil { if err := server.Shutdown(context.TODO()); err != nil {
log.Printf("Failed to shutdown metrics server: %v", err) log.Printf("Failed to shutdown metrics server: %v", err)
} }
}
} }
// makeNodeConfig parses incoming CLI options and returns node configuration object // makeNodeConfig parses incoming CLI options and returns node configuration object