mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-24 23:19:44 +00:00
check nil settings
This commit is contained in:
1 file changed
+6
@@ -26,6 +26,9 @@ func MarshalInboundConfig(protocol string, settings *any.Any) (interface{}, erro
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
if settings == nil {
|
||||||
|
return config, nil
|
||||||
|
}
|
||||||
if err := ptypes.UnmarshalAny(settings, config.(proto.Message)); err != nil {
|
if err := ptypes.UnmarshalAny(settings, config.(proto.Message)); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -37,6 +40,9 @@ func MarshalOutboundConfig(protocol string, settings *any.Any) (interface{}, err
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
if settings == nil {
|
||||||
|
return config, nil
|
||||||
|
}
|
||||||
if err := ptypes.UnmarshalAny(settings, config.(proto.Message)); err != nil {
|
if err := ptypes.UnmarshalAny(settings, config.(proto.Message)); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user