diff --git a/libnetwork/networkdb/networkdb_test.go b/libnetwork/networkdb/networkdb_test.go index a27398b407..963f567505 100644 --- a/libnetwork/networkdb/networkdb_test.go +++ b/libnetwork/networkdb/networkdb_test.go @@ -108,7 +108,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