httpd_output: assert that tag!=NULL

In the tag() method, MPD guarantees that it does not pass tag==NULL.
Converted the runtime check to an assertion.
This commit is contained in:
Max Kellermann 2009-05-05 22:36:44 +02:00
parent 7dcdb2ce39
commit 795569208a

View File

@ -378,16 +378,15 @@ httpd_output_tag(void *data, const struct tag *tag)
{
struct httpd_output *httpd = data;
if (httpd->metadata) {
page_unref (httpd->metadata);
httpd->metadata = NULL;
}
assert(tag != NULL);
if (tag)
httpd->metadata = icy_server_metadata_page(tag, TAG_ITEM_ALBUM,
TAG_ITEM_ARTIST,
TAG_ITEM_TITLE,
TAG_NUM_OF_ITEM_TYPES);
if (httpd->metadata != NULL)
page_unref (httpd->metadata);
httpd->metadata = icy_server_metadata_page(tag, TAG_ITEM_ALBUM,
TAG_ITEM_ARTIST,
TAG_ITEM_TITLE,
TAG_NUM_OF_ITEM_TYPES);
if (httpd->metadata) {
g_mutex_lock(httpd->mutex);