main: don't stop server if it wasn't started

This commit is contained in:
Tulir Asokan 2024-12-11 01:04:01 +02:00
parent f3da677565
commit 1e347a4c00

View file

@ -217,11 +217,13 @@ func (gmx *Gomuks) DirectStop() {
closer(websocket.StatusServiceRestart, "Server shutting down")
}
gmx.Client.Stop()
if gmx.Server != nil {
err := gmx.Server.Close()
if err != nil {
gmx.Log.Error().Err(err).Msg("Failed to close server")
}
}
}
func (gmx *Gomuks) Run() {
gmx.InitDirectories()