From 8da90a7f4afafbbe67dc4b9aa04dc531a3db1bce Mon Sep 17 00:00:00 2001 From: Eugene Bujak Date: Thu, 14 Feb 2019 17:33:50 +0300 Subject: [PATCH] Fix panic when https server is not running --- control.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/control.go b/control.go index bd7b673c..cc82abab 100644 --- a/control.go +++ b/control.go @@ -1086,7 +1086,7 @@ func handleTLSConfigure(w http.ResponseWriter, r *http.Request) { httpUpdateConfigReloadDNSReturnOK(w, r) // this needs to be done in a goroutine because Shutdown() is a blocking call, and it will block // until all requests are finished, and _we_ are inside a request right now, so it will block indefinitely - if restartHTTPS { + if restartHTTPS && httpsServer.server != nil { go func() { httpsServer.cond.Broadcast() httpsServer.server.Shutdown(context.TODO())