From 6791cf7d7f06de838cafecbe63892ff3ddb90ceb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20M=C3=B6ller?= Date: Sat, 12 May 2018 18:59:25 +0200 Subject: [PATCH] atexit: prevent Run from being called on nil signal --- lib/atexit/atexit.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/atexit/atexit.go b/lib/atexit/atexit.go index 8e44769d3..3f0bfa49a 100644 --- a/lib/atexit/atexit.go +++ b/lib/atexit/atexit.go @@ -29,7 +29,7 @@ func Register(fn func()) { signal.Notify(exitChan, os.Interrupt) // syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT go func() { sig, closed := <-exitChan - if closed { + if closed || sig == nil { return } fs.Infof(nil, "Signal received: %s", sig)