[queue] fix segfault if query for queue-items returned an empty result

set

This happen for example if a wrong path is passed in "mpc add
[virtual_path]"
This commit is contained in:
chme 2015-11-01 12:47:04 +01:00
parent 7a9b8d5c63
commit 0e0fbd006f

View File

@ -1187,6 +1187,12 @@ queueitem_make_byquery(struct query_params *qp)
return NULL;
}
if (!item_head || !item_tail)
{
DPRINTF(E_INFO, L_PLAYER, "No item found to add to queue\n");
return NULL;
}
item_head->prev = item_tail;
item_tail->next = item_head;
item_head->shuffle_prev = item_tail;