Skip to content

Commit

Permalink
Do not panic on debug /rlconfig if no config loaded (#306)
Browse files Browse the repository at this point in the history
* Do not panic on debug /rlconfig if no config loaded

Signed-off-by: James Fish <[email protected]>

* Format

Signed-off-by: James Fish <[email protected]>

* Collapse if

Signed-off-by: James Fish <[email protected]>
  • Loading branch information
fishcakez authored Oct 25, 2021
1 parent 21fc4d3 commit b163a2d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/service_cmd/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b163a2d

Please sign in to comment.