From e5394cdaa0ffb03ea7693900c8a3178398f89edf Mon Sep 17 00:00:00 2001 From: v2ray Date: Wed, 15 Jun 2016 11:58:28 +0200 Subject: [PATCH] Check if inbound and outbound config are set. --- shell/point/config_json.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/shell/point/config_json.go b/shell/point/config_json.go index b16e8ec62..68c229d8b 100644 --- a/shell/point/config_json.go +++ b/shell/point/config_json.go @@ -40,7 +40,15 @@ func (this *Config) UnmarshalJSON(data []byte) error { this.Port = jsonConfig.Port this.LogConfig = jsonConfig.LogConfig this.RouterConfig = jsonConfig.RouterConfig + + if jsonConfig.InboundConfig == nil { + return errors.New("Point: Inbound config is not specified.") + } this.InboundConfig = jsonConfig.InboundConfig + + if jsonConfig.OutboundConfig == nil { + return errors.New("Point: Outbound config is not specified.") + } this.OutboundConfig = jsonConfig.OutboundConfig this.InboundDetours = jsonConfig.InboundDetours this.OutboundDetours = jsonConfig.OutboundDetours