1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-21 09:36:34 -05:00

check nil settings

This commit is contained in:
Darien Raymond 2016-10-14 21:19:45 +02:00
parent f488a63d97
commit f87d7f36f5
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -26,6 +26,9 @@ func MarshalInboundConfig(protocol string, settings *any.Any) (interface{}, erro
if err != nil {
return nil, err
}
if settings == nil {
return config, nil
}
if err := ptypes.UnmarshalAny(settings, config.(proto.Message)); err != nil {
return nil, err
}
@ -37,6 +40,9 @@ func MarshalOutboundConfig(protocol string, settings *any.Any) (interface{}, err
if err != nil {
return nil, err
}
if settings == nil {
return config, nil
}
if err := ptypes.UnmarshalAny(settings, config.(proto.Message)); err != nil {
return nil, err
}