From 795569208a6f81afc35b61312b168aa9225dddfe Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 5 May 2009 22:36:44 +0200 Subject: 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. --- src/output/httpd_output_plugin.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/output') diff --git a/src/output/httpd_output_plugin.c b/src/output/httpd_output_plugin.c index c1f609489..b9befb0d6 100644 --- a/src/output/httpd_output_plugin.c +++ b/src/output/httpd_output_plugin.c @@ -378,16 +378,15 @@ httpd_output_tag(void *data, const struct tag *tag) { struct httpd_output *httpd = data; - if (httpd->metadata) { + assert(tag != NULL); + + if (httpd->metadata != NULL) page_unref (httpd->metadata); - httpd->metadata = NULL; - } - if (tag) - httpd->metadata = icy_server_metadata_page(tag, TAG_ITEM_ALBUM, - TAG_ITEM_ARTIST, - TAG_ITEM_TITLE, - TAG_NUM_OF_ITEM_TYPES); + 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); -- cgit v1.2.3