Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

atexit: prevent Run from being called on nil signal

Fabian Möller6791cf7d7f06
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)