Merge pull request #45071 from corhere/backport-23.0/libnet/fix-networkdb-test-panic

[23.0 backport] libnet/networkdb: fix nil-dereference panic in test
This commit is contained in:
Cory Snider 2023-02-23 19:14:27 -05:00 committed by GitHub
commit bfc8e1ae36
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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