diff --git a/adapter/outbound/wireguard.go b/adapter/outbound/wireguard.go index 53f7cadf6..10c8a260b 100644 --- a/adapter/outbound/wireguard.go +++ b/adapter/outbound/wireguard.go @@ -386,6 +386,10 @@ func NewWireGuard(option WireGuardOption) (*WireGuard, error) { } outbound.bind = wireguard.NewClientBind(context.Background(), wgSingErrorHandler{outbound.Name()}, singDialer, isConnect, outbound.connectAddr.AddrPort(), reserved) + if outbound.bind == nil { + return nil, E.New("failed to create wireguard client bind") + } + var err error outbound.localPrefixes, err = option.Prefixes() if err != nil {