fix: nil dereference on marshalling service health

This commit is contained in:
yusing 2025-04-14 06:27:19 +08:00
parent fa16f4150a
commit a2e253591c

View file

@ -22,7 +22,10 @@ type JSONRepresentation struct {
} }
func (jsonRepr *JSONRepresentation) MarshalMap() map[string]any { func (jsonRepr *JSONRepresentation) MarshalMap() map[string]any {
url := jsonRepr.URL.String() var url string
if jsonRepr.URL != nil {
url = jsonRepr.URL.String()
}
if url == "http://:0" { if url == "http://:0" {
url = "" url = ""
} }