libnet/networkdb: fix nil-dereference panic in test

Signed-off-by: Cory Snider <csnider@mirantis.com>
(cherry picked from commit 88f6b637a0)
Signed-off-by: Cory Snider <csnider@mirantis.com>
This commit is contained in:
Cory Snider 2023-02-23 14:31:48 -05:00
parent bb063342ca
commit 2337258d28

View file

@ -109,7 +109,10 @@ func (db *NetworkDB) verifyNetworkExistence(t *testing.T, node string, id string
nn, nnok := db.networks[node]
if nnok {
n, ok := nn[id]
leaving := n.leaving
var leaving bool
if ok {
leaving = n.leaving
}
db.RUnlock()
if present && ok {
return