aboutsummaryrefslogtreecommitdiffstats
path: root/src/command/NeighborCommands.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-26 01:17:49 +0100
committerMax Kellermann <max@duempel.org>2014-01-26 01:17:49 +0100
commit642be502c0e4767568347ff82cde561b40f93d25 (patch)
tree27d53d7733aea6650fc72bce8f7f5cba193697cb /src/command/NeighborCommands.cxx
parent5c4a42caa088335868342b25a834962cbc0d08a2 (diff)
downloadmpd-642be502c0e4767568347ff82cde561b40f93d25.tar.gz
mpd-642be502c0e4767568347ff82cde561b40f93d25.tar.xz
mpd-642be502c0e4767568347ff82cde561b40f93d25.zip
NeighborCommands: convert assertion to runtime check
Diffstat (limited to 'src/command/NeighborCommands.cxx')
-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)