Explorar el Código

handle error when load point config

V2Ray hace 10 años
padre
commit
507da1a451
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4 0
      config/json/json.go

+ 4 - 0
config/json/json.go

@@ -59,6 +59,10 @@ func LoadConfig(file string) (*Config, error) {
 
 	config := &Config{}
 	err = json.Unmarshal(rawConfig, config)
+	if err != nil {
+		log.Error("Failed to load point config: %v", err)
+		return nil, err
+	}
 
 	if !filepath.IsAbs(config.InboundConfigValue.File) && len(config.InboundConfigValue.File) > 0 {
 		config.InboundConfigValue.File = filepath.Join(filepath.Dir(fixedFile), config.InboundConfigValue.File)