diff options
author | Richard Hughes <richard@hughsie.com> | 2014-04-23 10:57:37 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2014-04-23 10:58:19 +0100 |
commit | c4ed10ee20c65d261228c142399266245e7ee957 (patch) | |
tree | 0558ff919b7a2921e7a8ec5fd45b3950a1ee000d | |
parent | 07974c197f39da2d69d4c5f606e5b5d8caae3ea7 (diff) | |
download | appstream-glib-c4ed10ee20c65d261228c142399266245e7ee957.tar.gz |
Do not crash if an AppStream entry has no ID
-rw-r--r-- | libappstream-glib/as-store.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libappstream-glib/as-store.c b/libappstream-glib/as-store.c index 01d3f06..b597083 100644 --- a/libappstream-glib/as-store.c +++ b/libappstream-glib/as-store.c @@ -297,6 +297,10 @@ as_store_add_app (AsStore *store, AsApp *app) /* have we recorded this before? */ id = as_app_get_id_full (app); + if (id == NULL) { + g_warning ("application has no ID set"); + return; + } item = g_hash_table_lookup (priv->hash_id, id); if (item != NULL) { |