fix(saas): panic: runtime error: comparing uncomparable type config.PortScanConf (#1537)
This commit is contained in:
@@ -103,6 +103,9 @@ func writeToFile(cnf config.Config, path string) error {
|
||||
if cnf.Default.WordPress != nil && cnf.Default.WordPress.IsZero() {
|
||||
cnf.Default.WordPress = nil
|
||||
}
|
||||
if cnf.Default.PortScan != nil && cnf.Default.PortScan.IsZero() {
|
||||
cnf.Default.PortScan = nil
|
||||
}
|
||||
|
||||
c := struct {
|
||||
Saas *config.SaasConf `toml:"saas"`
|
||||
@@ -198,5 +201,11 @@ func cleanForTOMLEncoding(server config.ServerInfo, def config.ServerInfo) confi
|
||||
}
|
||||
}
|
||||
|
||||
if server.PortScan != nil {
|
||||
if server.PortScan.IsZero() || reflect.DeepEqual(server.PortScan, def.PortScan) {
|
||||
server.PortScan = nil
|
||||
}
|
||||
}
|
||||
|
||||
return server
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user