Commit c42b2062 authored by Max Kellermann's avatar Max Kellermann

DatabaseCommands: allow empty criteria for "list"

Fixes regression.
parent 733d6a6b
...@@ -214,7 +214,7 @@ handle_list(struct client *client, int argc, char *argv[]) ...@@ -214,7 +214,7 @@ handle_list(struct client *client, int argc, char *argv[])
conditionals = conditionals =
locate_item_list_new_single((unsigned)TAG_ARTIST, locate_item_list_new_single((unsigned)TAG_ARTIST,
argv[2]); argv[2]);
} else { } else if (argc > 2) {
conditionals = conditionals =
locate_item_list_parse(argv + 2, argc - 2, false); locate_item_list_parse(argv + 2, argc - 2, false);
if (conditionals == NULL) { if (conditionals == NULL) {
...@@ -222,7 +222,8 @@ handle_list(struct client *client, int argc, char *argv[]) ...@@ -222,7 +222,8 @@ handle_list(struct client *client, int argc, char *argv[])
"not able to parse args"); "not able to parse args");
return COMMAND_RETURN_ERROR; return COMMAND_RETURN_ERROR;
} }
} } else
conditionals = nullptr;
GError *error = NULL; GError *error = NULL;
enum command_return ret = enum command_return ret =
...@@ -230,7 +231,8 @@ handle_list(struct client *client, int argc, char *argv[]) ...@@ -230,7 +231,8 @@ handle_list(struct client *client, int argc, char *argv[])
? COMMAND_RETURN_OK ? COMMAND_RETURN_OK
: print_error(client, error); : print_error(client, error);
locate_item_list_free(conditionals); if (conditionals != nullptr)
locate_item_list_free(conditionals);
return ret; return ret;
} }
......
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