diff options
author | Richard Hughes <richard@hughsie.com> | 2016-04-29 08:42:52 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2016-04-29 08:42:52 +0100 |
commit | 5ec844a770883b624ad8ea6bc331975c7358a683 (patch) | |
tree | 226f5629ddea4acef824d56d1b9f257349f1403c /libappstream-glib/as-icon.c | |
parent | c75108170d9e7010bab9b6ba727c2aaa6707981d (diff) | |
download | appstream-glib-5ec844a770883b624ad8ea6bc331975c7358a683.tar.gz |
trivial: Fix a critical warning when an AppData file has invalid input
In this case, <icon type="local"/> is what makes it explode.
Diffstat (limited to 'libappstream-glib/as-icon.c')
-rw-r--r-- | libappstream-glib/as-icon.c | 8 |
1 files changed, 8 insertions, 0 deletions
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) |