Skip to content

Commit

Permalink
fix(saas): panic: runtime error: comparing uncomparable type config.P…
Browse files Browse the repository at this point in the history
…ortScanConf (#1537)
  • Loading branch information
kotakanbe authored Oct 4, 2022
1 parent 6963442 commit eb87d5d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions saas/uuid.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -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
}

0 comments on commit eb87d5d

Please sign in to comment.