fix: loadbalance group npe

This commit is contained in:
Skyxim 2022-05-04 19:52:48 +08:00
parent fb58595d44
commit 9969e1706e

View file

@ -36,6 +36,10 @@ func parseStrategy(config map[string]any) string {
} }
func getKey(metadata *C.Metadata) string { func getKey(metadata *C.Metadata) string {
if metadata == nil {
return ""
}
if metadata.Host != "" { if metadata.Host != "" {
// ip host // ip host
if ip := net.ParseIP(metadata.Host); ip != nil { if ip := net.ParseIP(metadata.Host); ip != nil {