diff --git a/src/MainWindow.vala b/src/MainWindow.vala index 4d515656..0189b091 100644 --- a/src/MainWindow.vala +++ b/src/MainWindow.vala @@ -134,6 +134,14 @@ public class Feedback.MainWindow : Gtk.ApplicationWindow { var component_table = new HashTable (str_hash, str_equal); appstream_pool.get_components_by_id (app).as_array ().foreach ((component) => { + var url = component.get_url (AppStream.UrlKind.BUGTRACKER); + if (url == null) { + // Ignore components without a bugtracker URL because rows that just show + // a component name and can't take users to report issues are useless + warning ("BUGTRACKER URL is not set in the component '%s'", component.name); + return; + } + if (component_table[component.id] == null) { component_table[component.id] = component; @@ -141,7 +149,7 @@ public class Feedback.MainWindow : Gtk.ApplicationWindow { component.name, icon_from_appstream_component (component), Category.DEFAULT_APPS, - component.get_url (AppStream.UrlKind.BUGTRACKER) + url ); listbox.append (repo_row); @@ -154,11 +162,19 @@ public class Feedback.MainWindow : Gtk.ApplicationWindow { components.foreach ((component) => { // FIXME: This should use kind != DESKTOP_APP but some metainfo is currently inaccurate if (component.kind != ADDON && !(component.id in app_entries)) { + var url = component.get_url (AppStream.UrlKind.BUGTRACKER); + if (url == null) { + // Ignore components without a bugtracker URL because rows that just show + // a component name and can't take users to report issues are useless + warning ("BUGTRACKER URL is not set in the component '%s'", component.name); + return; + } + var repo_row = new RepoRow ( component.name, icon_from_appstream_component (component), Category.SYSTEM, - component.get_url (AppStream.UrlKind.BUGTRACKER) + url ); listbox.append (repo_row); @@ -169,22 +185,38 @@ public class Feedback.MainWindow : Gtk.ApplicationWindow { }); appstream_pool.get_components_by_extends ("io.elementary.settings").as_array ().foreach ((component) => { + var url = component.get_url (AppStream.UrlKind.BUGTRACKER); + if (url == null) { + // Ignore components without a bugtracker URL because rows that just show + // a component name and can't take users to report issues are useless + warning ("BUGTRACKER URL is not set in the component '%s'", component.name); + return; + } + var repo_row = new RepoRow ( component.name, icon_from_appstream_component (component), Category.SETTINGS, - component.get_url (AppStream.UrlKind.BUGTRACKER) + url ); listbox.append (repo_row); }); appstream_pool.get_components_by_extends ("io.elementary.wingpanel").as_array ().foreach ((component) => { + var url = component.get_url (AppStream.UrlKind.BUGTRACKER); + if (url == null) { + // Ignore components without a bugtracker URL because rows that just show + // a component name and can't take users to report issues are useless + warning ("BUGTRACKER URL is not set in the component '%s'", component.name); + return; + } + var repo_row = new RepoRow ( component.name, icon_from_appstream_component (component), Category.PANEL, - component.get_url (AppStream.UrlKind.BUGTRACKER) + url ); listbox.append (repo_row);