From 9969e1706e06377a9491f0ba02de45368e90260d Mon Sep 17 00:00:00 2001 From: Skyxim Date: Wed, 4 May 2022 19:52:48 +0800 Subject: [PATCH] fix: loadbalance group npe --- adapter/outboundgroup/loadbalance.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/adapter/outboundgroup/loadbalance.go b/adapter/outboundgroup/loadbalance.go index f0342c56..198bf60d 100644 --- a/adapter/outboundgroup/loadbalance.go +++ b/adapter/outboundgroup/loadbalance.go @@ -36,6 +36,10 @@ func parseStrategy(config map[string]any) string { } func getKey(metadata *C.Metadata) string { + if metadata == nil { + return "" + } + if metadata.Host != "" { // ip host if ip := net.ParseIP(metadata.Host); ip != nil {