check if address is set

This commit is contained in:
v2ray committed 2016-06-12 22:54:33 +02:00
1 parent 679d646571
commit 8a5f37dad7
2 files changed
+12 -2

No files matched your search

+3 -1
View File
@@ -22,7 +22,9 @@ func (this *Config) UnmarshalJSON(data []byte) error {
if err := json.Unmarshal(data, rawConfig); err != nil {
return errors.New("Dokodemo: Failed to parse config: " + err.Error())
}
this.Address = rawConfig.Host.Address
if rawConfig.Host != nil {
this.Address = rawConfig.Host.Address
}
this.Port = rawConfig.PortValue
this.Network = rawConfig.NetworkList
this.Timeout = rawConfig.TimeoutValue