aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/command/NeighborCommands.cxx6
1 files changed, 5 insertions, 1 deletions
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)