Merge pull request from corhere/libnet/fix-networkdb-test-panic

libnet/networkdb: fix nil-dereference panic in test
This commit is contained in:
Bjorn Neergaard 2023-02-23 15:22:31 -07:00 committed by GitHub
commit 2f0e308c7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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