From 642be502c0e4767568347ff82cde561b40f93d25 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 26 Jan 2014 01:17:49 +0100 Subject: NeighborCommands: convert assertion to runtime check --- src/command/NeighborCommands.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/command/NeighborCommands.cxx b/src/command/NeighborCommands.cxx index e68e8ef15..ee88c7935 100644 --- a/src/command/NeighborCommands.cxx +++ b/src/command/NeighborCommands.cxx @@ -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) -- cgit v1.2.3