command: don't error when sticker list is run on song with no stickers

this is inconsistent with other commands (e.g. find) and seems wrong --
a song with no stickers attached is a perfectly valid state and an empty
list of stickers is also perfectly valid.
This commit is contained in:
Anton Khirnov 2010-11-27 20:36:11 +01:00 committed by Max Kellermann
parent 429ed24c99
commit cb9965bab5
1 changed files with 3 additions and 7 deletions

View File

@ -1715,15 +1715,11 @@ handle_sticker_song(struct client *client, int argc, char *argv[])
}
sticker = sticker_song_get(song);
if (NULL == sticker) {
command_error(client, ACK_ERROR_NO_EXIST,
"no stickers found");
return COMMAND_RETURN_ERROR;
if (sticker) {
sticker_print(client, sticker);
sticker_free(sticker);
}
sticker_print(client, sticker);
sticker_free(sticker);
return COMMAND_RETURN_OK;
/* set song song_id id key */
} else if (argc == 6 && strcmp(argv[1], "set") == 0) {