From f29a9eee0d062d7fb975d8779db4ea8a07d26f7d Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Wed, 2 Oct 2019 23:39:32 -0600 Subject: [PATCH] caddytls: nil check on storageClean fields on Stop --- modules/caddytls/tls.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/caddytls/tls.go b/modules/caddytls/tls.go index c4088ad7..cb27a9ed 100644 --- a/modules/caddytls/tls.go +++ b/modules/caddytls/tls.go @@ -159,8 +159,12 @@ func (t *TLS) Start() error { // Stop stops the TLS module and cleans up any allocations. func (t *TLS) Stop() error { // stop the storage cleaner goroutine and ticker - close(t.storageCleanStop) - t.storageCleanTicker.Stop() + if t.storageCleanStop != nil { + close(t.storageCleanStop) + } + if t.storageCleanTicker != nil { + t.storageCleanTicker.Stop() + } return nil }