Pull request: home: fix install panic

Closes #3596.

Squashed commit of the following:

commit e14f8795859cf775b360d4fe2f5c1d0eebb87ba6
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Tue Sep 14 17:49:48 2021 +0300

    home: fix install panic
This commit is contained in:
Ainar Garipov
2021-09-14 18:03:14 +03:00
parent 857f876486
commit 48b0cefb29
2 changed files with 7 additions and 5 deletions

View File

@@ -257,7 +257,8 @@ type applyConfigReq struct {
Password string `json:"password"`
}
// Copy installation parameters between two configuration objects
// copyInstallSettings copies the installation parameters between two
// configuration structures.
func copyInstallSettings(dst, src *configuration) {
dst.BindHost = src.BindHost
dst.BindPort = src.BindPort
@@ -307,7 +308,7 @@ func (web *Web) handleInstallConfigure(w http.ResponseWriter, r *http.Request) {
return
}
var curConfig *configuration
curConfig := &configuration{}
copyInstallSettings(curConfig, config)
Context.firstRun = false