Commit 642be502 authored by Max Kellermann's avatar Max Kellermann

NeighborCommands: convert assertion to runtime check

parent 5c4a42ca
......@@ -41,7 +41,11 @@ CommandResult
handle_listneighbors(Client &client,
gcc_unused int argc, gcc_unused char *argv[])
{
assert(instance->neighbors != nullptr);
if (instance->neighbors == nullptr) {
command_error(client, ACK_ERROR_UNKNOWN,
"No neighbor plugin configured");
return CommandResult::ERROR;
}
const auto neighbors = instance->neighbors->GetList();
for (const auto &i : neighbors)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment