diff --git a/src/neighbors.cc b/src/neighbors.cc index 9ca8bdfca93..72d71cf7788 100644 --- a/src/neighbors.cc +++ b/src/neighbors.cc @@ -1500,8 +1500,10 @@ dump_peers(StoreEntry *sentry, CachePeers *peers) char ntoabuf[MAX_IPSTRLEN]; int i; - if (peers == nullptr) + if (!peers) { storeAppendPrintf(sentry, "There are no neighbors installed.\n"); + return; + } for (const auto &peer: *peers) { const auto e = peer.get();