From b163a2d5fe344bf7603a5aae83d0cd5fb9e56088 Mon Sep 17 00:00:00 2001 From: James Fish Date: Mon, 25 Oct 2021 11:16:41 -0700 Subject: [PATCH] Do not panic on debug /rlconfig if no config loaded (#306) * Do not panic on debug /rlconfig if no config loaded Signed-off-by: James Fish * Format Signed-off-by: James Fish * Collapse if Signed-off-by: James Fish --- src/service_cmd/runner/runner.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/service_cmd/runner/runner.go b/src/service_cmd/runner/runner.go index 8be85288..3d616229 100644 --- a/src/service_cmd/runner/runner.go +++ b/src/service_cmd/runner/runner.go @@ -117,7 +117,9 @@ func (runner *Runner) Run() { "/rlconfig", "print out the currently loaded configuration for debugging", func(writer http.ResponseWriter, request *http.Request) { - io.WriteString(writer, service.GetCurrentConfig().Dump()) + if current := service.GetCurrentConfig(); current != nil { + io.WriteString(writer, current.Dump()) + } }) srv.AddJsonHandler(service)