From e8ac0412a5e8b57a15fc23d627545f0fa88c620c Mon Sep 17 00:00:00 2001 From: Shelikhoo Date: Fri, 5 Mar 2021 16:27:02 +0000 Subject: [PATCH] workaround crash when V is not in context --- transport/internet/tagged/taggedimpl/impl.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/transport/internet/tagged/taggedimpl/impl.go b/transport/internet/tagged/taggedimpl/impl.go index 5688c58e7..bf5fde74a 100644 --- a/transport/internet/tagged/taggedimpl/impl.go +++ b/transport/internet/tagged/taggedimpl/impl.go @@ -13,6 +13,9 @@ import ( func DialTaggedOutbound(ctx context.Context, dest net.Destination, tag string) (net.Conn, error) { var dispatcher routing.Dispatcher + if core.FromContext(ctx) == nil { + return nil, newError("Instance context variable is not in context, dial denied. ") + } if err := core.RequireFeatures(ctx, func(dispatcherInstance routing.Dispatcher) { dispatcher = dispatcherInstance }); err != nil {