Browse Source

Fix nil interface

V2Ray 10 năm trước cách đây
mục cha
commit
01b1f9b898
1 tập tin đã thay đổi với 9 bổ sung0 xóa
  1. 9 0
      config/json/json.go

+ 9 - 0
config/json/json.go

@@ -53,14 +53,23 @@ func (config *Config) Port() uint16 {
 }
 
 func (config *Config) LogConfig() config.LogConfig {
+  if config.LogConfigValue == nil {
+    return nil
+  }
 	return config.LogConfigValue
 }
 
 func (config *Config) InboundConfig() config.ConnectionConfig {
+  if config.InboundConfigValue == nil {
+    return nil
+  }
 	return config.InboundConfigValue
 }
 
 func (config *Config) OutboundConfig() config.ConnectionConfig {
+  if config.OutboundConfigValue == nil {
+    return nil
+  }
 	return config.OutboundConfigValue
 }