remove nil statement

This commit is contained in:
thinkerou 2021-03-27 20:37:01 +08:00
parent 2d7fc06969
commit 3483d2c07d

View File

@ -767,8 +767,7 @@ func (c *Context) RemoteIP() (net.IP, bool) {
return nil, false
}
trustedCIDRs, err := c.engine.prepareTrustedCIDRs()
if err == nil {
trustedCIDRs, _ := c.engine.prepareTrustedCIDRs()
c.engine.trustedCIDRs = trustedCIDRs
if c.engine.trustedCIDRs != nil {
for _, cidr := range c.engine.trustedCIDRs {
@ -777,7 +776,6 @@ func (c *Context) RemoteIP() (net.IP, bool) {
}
}
}
}
return remoteIP, false
}