Kaynağa Gözat

Check if inbound and outbound config are set.

v2ray 9 yıl önce
ebeveyn
işleme
e5394cdaa0
1 değiştirilmiş dosya ile 8 ekleme ve 0 silme
  1. 8 0
      shell/point/config_json.go

+ 8 - 0
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