Fix: crash when ip is nil

This commit is contained in:
Dreamacro 2019-02-12 12:29:33 +08:00
parent 26a87f9d34
commit 5920b05752

View File

@ -24,7 +24,7 @@ func (i *IPCIDR) IsMatch(metadata *C.Metadata) bool {
if i.isSourceIP {
ip = metadata.SourceIP
}
return i.ipnet.Contains(*ip)
return ip != nil && i.ipnet.Contains(*ip)
}
func (i *IPCIDR) Adapter() string {