1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-30 05:56:54 -05:00

workaround crash when V is not in context

This commit is contained in:
Shelikhoo 2021-03-05 16:27:02 +00:00
parent 1f9c4eebb8
commit e8ac0412a5
No known key found for this signature in database
GPG Key ID: C4D5E79D22B25316

View File

@ -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 {