[gnome-software/wip/gs-plugin-appstream-ignore-refine-with-no-id] gs-plugin-appstream: Ignore refine for apps with no ID
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/gs-plugin-appstream-ignore-refine-with-no-id] gs-plugin-appstream: Ignore refine for apps with no ID
- Date: Fri, 8 Jul 2022 09:34:16 +0000 (UTC)
commit 9a353db02dae724ccc90e74ae3deab43fd642b4a
Author: Milan Crha <mcrha redhat com>
Date: Fri Jul 8 11:32:18 2022 +0200
gs-plugin-appstream: Ignore refine for apps with no ID
It can happen a plugin (in my case PackageKit) returns apps for update, which do
not have set their ID. Trying to fins such app in an XbSilo resulted in an error:
failed to process component/id[text()='(null)']: cannot parse text or number `null`
which prevented the Updates page to show anything. Ignoring such apps does not
influence the System Updates, these bare packages are part of it too.
plugins/core/gs-plugin-appstream.c | 4 ++++
1 file changed, 4 insertions(+)
---
diff --git a/plugins/core/gs-plugin-appstream.c b/plugins/core/gs-plugin-appstream.c
index 7755a177b..5258ec129 100644
--- a/plugins/core/gs-plugin-appstream.c
+++ b/plugins/core/gs-plugin-appstream.c
@@ -1050,6 +1050,10 @@ gs_plugin_appstream_refine_state (GsPluginAppstream *self,
g_autoptr(GRWLockReaderLocker) locker = NULL;
g_autoptr(XbNode) component = NULL;
+ /* Ignore apps with no ID */
+ if (gs_app_get_id (app) == NULL)
+ return TRUE;
+
locker = g_rw_lock_reader_locker_new (&self->silo_lock);
xpath = g_strdup_printf ("component/id[text()='%s']", gs_app_get_id (app));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]