diff options
author | Richard Hughes <richard@hughsie.com> | 2021-04-15 09:01:01 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2021-04-15 09:57:51 +0100 |
commit | 44e20bd2e921464185fd12a1ea43b691779a127b (patch) | |
tree | 05aee4f6d39c28196c396aadbb5e293e712a2822 /libappstream-glib/as-suggest.c | |
parent | c795c69c3cbf695e94408765f9bace45bb5f2b85 (diff) | |
download | appstream-glib-44e20bd2e921464185fd12a1ea43b691779a127b.tar.gz |
Do not show a critical warning on <suggests><id/></suggests>
Fixes https://github.com/hughsie/appstream-glib/issues/396
Diffstat (limited to 'libappstream-glib/as-suggest.c')
-rw-r--r-- | libappstream-glib/as-suggest.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libappstream-glib/as-suggest.c b/libappstream-glib/as-suggest.c index d9f90ac..707f3a0 100644 --- a/libappstream-glib/as-suggest.c +++ b/libappstream-glib/as-suggest.c @@ -168,6 +168,7 @@ as_suggest_add_id (AsSuggest *suggest, const gchar *id) { AsSuggestPrivate *priv = GET_PRIVATE (suggest); g_return_if_fail (AS_IS_SUGGEST (suggest)); + g_return_if_fail (id != NULL); g_ptr_array_add (priv->ids, as_ref_string_new (id)); } @@ -233,7 +234,8 @@ as_suggest_node_parse (AsSuggest *suggest, GNode *node, if (tmp != NULL) as_suggest_set_kind (suggest, as_suggest_kind_from_string (tmp)); for (c = node->children; c != NULL; c = c->next) { - if (as_node_get_tag (c) == AS_TAG_ID) + if (as_node_get_tag (c) == AS_TAG_ID && + as_node_get_data (c) != NULL) as_suggest_add_id (suggest, as_node_get_data (c)); } return TRUE; |