[gnome-software: 2/3] Add comment about as_metadata_components_to_collection behaviour




commit c18a0cc9206095676cb91a6f0f4b438820cc079d
Author: Robert Ancell <robert ancell canonical com>
Date:   Tue May 25 10:38:08 2021 +1200

    Add comment about as_metadata_components_to_collection behaviour

 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 a013711c0..c771f74a5 100644
--- a/plugins/core/gs-plugin-appstream.c
+++ b/plugins/core/gs-plugin-appstream.c
@@ -348,6 +348,10 @@ gs_plugin_appstream_load_dep11_cb (XbBuilderSource *self,
 
        xml = as_metadata_components_to_collection (mdata, AS_FORMAT_KIND_XML, &tmp_error);
        if (xml == NULL) {
+               // This API currently returns NULL if there is nothing to serialize, so we
+               // have to test if this is an error or not.
+               // See https://gitlab.gnome.org/GNOME/gnome-software/-/merge_requests/763
+               // for discussion about changing this API.
                if (tmp_error != NULL) {
                        g_propagate_error (error, g_steal_pointer (&tmp_error));
                        return NULL;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]