Fix: guard against nil pointer dereference of (*NetworkList)

This commit is contained in:
Huang-Huang Bao
2022-09-07 10:50:17 +01:00
committed by Xiaokang Wang (Shelikhoo)
parent 6fcdf998f1
commit ddc6312c5d
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -239,7 +239,7 @@ func init() {
}
rule.Domain = v.Domain
rule.GeoDomain = v.GeoDomain
rule.Networks = v.Networks.Network
rule.Networks = v.Networks.GetNetwork()
rule.Protocol = v.Protocol
rule.Attributes = v.Attributes
rule.UserEmail = v.UserEmail
+1 -1
View File
@@ -71,7 +71,7 @@ func (d *Door) Network() []net.Network {
return d.config.Networks
}
return d.config.NetworkList.Network
return d.config.NetworkList.GetNetwork()
}
func (d *Door) policy() policy.Session {
+1 -1
View File
@@ -19,7 +19,7 @@ func init() {
CipherType: simplifiedServer.Method,
}),
},
Network: simplifiedServer.Networks.Network,
Network: simplifiedServer.Networks.GetNetwork(),
PacketEncoding: simplifiedServer.PacketEncoding,
}