From 5ec844a770883b624ad8ea6bc331975c7358a683 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Fri, 29 Apr 2016 08:42:52 +0100 Subject: trivial: Fix a critical warning when an AppData file has invalid input In this case, is what makes it explode. --- libappstream-glib/as-icon.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libappstream-glib/as-icon.c b/libappstream-glib/as-icon.c index 739234f..21f3bf5 100644 --- a/libappstream-glib/as-icon.c +++ b/libappstream-glib/as-icon.c @@ -642,6 +642,14 @@ as_icon_node_parse (AsIcon *icon, GNode *node, /* preserve the URL for remote icons */ tmp = as_node_get_data (node); + if (tmp == NULL) { + g_set_error (error, + AS_ICON_ERROR, + AS_ICON_ERROR_FAILED, + "no data for icon of type %s", + as_icon_kind_to_string (priv->kind)); + return FALSE; + } if (priv->kind == AS_ICON_KIND_REMOTE) as_icon_set_url (icon, tmp); else if (priv->kind == AS_ICON_KIND_LOCAL) -- cgit v1.2.1