hostnetworks: GetHostNetworkByAddress(): fix logic invert

This commit is contained in:
Yousong Zhou
2018-08-24 12:39:07 +00:00
parent 745f97e912
commit 96ceaafd2f
+1 -1
View File
@@ -92,7 +92,7 @@ func (man *SHostnetworkManager) QueryByAddress(addr string) *sqlchemy.SQuery {
func (man *SHostnetworkManager) GetHostNetworkByAddress(addr string) *SHostnetwork {
network := SHostnetwork{}
err := man.QueryByAddress(addr).First(&network)
if err != nil {
if err == nil {
return &network
}
return nil