commands: Avoid panic in error handler on config errors

This commit is contained in:
Bjørn Erik Pedersen 2018-10-22 19:50:27 +02:00
parent 5a52cd5f92
commit 6f3716dc22
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F

View file

@ -334,7 +334,11 @@ func (f *fileServer) createEndpoint(i int) (*http.ServeMux, string, string, erro
if err != nil {
f.c.logger.ERROR.Println(err)
}
fmt.Fprint(w, injectLiveReloadScript(&b, f.c.Cfg.GetInt("liveReloadPort")))
port = 1313
if !f.c.paused {
port = f.c.Cfg.GetInt("liveReloadPort")
}
fmt.Fprint(w, injectLiveReloadScript(&b, port))
return
}