aboutsummaryrefslogtreecommitdiffstats
path: root/src/DatabaseCommands.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-08-08 01:16:40 +0200
committerMax Kellermann <max@duempel.org>2012-08-08 01:16:47 +0200
commitc42b20629265a953ecced484a29d7208bcff367b (patch)
tree3f5f33f02b498a75005c2c554d94cdbf66bee4ee /src/DatabaseCommands.cxx
parent733d6a6b16686c852b6d0fc0e4e9197add501a2f (diff)
downloadmpd-c42b20629265a953ecced484a29d7208bcff367b.tar.gz
mpd-c42b20629265a953ecced484a29d7208bcff367b.tar.xz
mpd-c42b20629265a953ecced484a29d7208bcff367b.zip
DatabaseCommands: allow empty criteria for "list"
Fixes regression.
Diffstat (limited to '')
-rw-r--r--src/DatabaseCommands.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/DatabaseCommands.cxx b/src/DatabaseCommands.cxx
index 9dbe4e47f..288980468 100644
--- a/src/DatabaseCommands.cxx
+++ b/src/DatabaseCommands.cxx
@@ -214,7 +214,7 @@ handle_list(struct client *client, int argc, char *argv[])
conditionals =
locate_item_list_new_single((unsigned)TAG_ARTIST,
argv[2]);
- } else {
+ } else if (argc > 2) {
conditionals =
locate_item_list_parse(argv + 2, argc - 2, false);
if (conditionals == NULL) {
@@ -222,7 +222,8 @@ handle_list(struct client *client, int argc, char *argv[])
"not able to parse args");
return COMMAND_RETURN_ERROR;
}
- }
+ } else
+ conditionals = nullptr;
GError *error = NULL;
enum command_return ret =
@@ -230,7 +231,8 @@ handle_list(struct client *client, int argc, char *argv[])
? COMMAND_RETURN_OK
: print_error(client, error);
- locate_item_list_free(conditionals);
+ if (conditionals != nullptr)
+ locate_item_list_free(conditionals);
return ret;
}