mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2025-01-05 17:13:32 +08:00
Fix: crash when ip is nil
This commit is contained in:
parent
26a87f9d34
commit
5920b05752
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user