Skip to content

Commit

Permalink
Fix handling of zero cache_peers (#1499)
Browse files Browse the repository at this point in the history
The bug was introduced in recent commit 2e24d0b.
  • Loading branch information
eduard-bagdasaryan authored and squid-anubis committed Oct 3, 2023
1 parent 20739f5 commit c375465
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/neighbors.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1502,8 +1502,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();
Expand Down

0 comments on commit c375465

Please sign in to comment.