[gnome-boxes/gnome-41] util-app: Don't add OS to download list if URL is null
- From: Felipe Borges <felipeborges src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes/gnome-41] util-app: Don't add OS to download list if URL is null
- Date: Mon, 4 Oct 2021 15:19:21 +0000 (UTC)
commit 93759ab381dc2c8d9c80411c49e3479551c14405
Author: Felipe Borges <felipeborges gnome org>
Date: Mon Oct 4 11:54:49 2021 +0200
util-app: Don't add OS to download list if URL is null
In issue #726 we see a case for when an OSes added to our
recommended-downloads.xml list doesn't have an URL, causing an error.
Since we encourage downstreams to tweak this list, we should prevent
such synchronization (osinfo-db and Boxes) issues from happening.
Let's check for media.url before adding the OSes.
src/util-app.vala | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/util-app.vala b/src/util-app.vala
index b3ec5376..c59c382a 100644
--- a/src/util-app.vala
+++ b/src/util-app.vala
@@ -209,7 +209,8 @@ else if (media_url.contains ("dvd"))
var os = yield os_db.get_os_by_id (os_id);
var media = os.get_media_list ().get_nth (0) as Osinfo.Media;
- list.append (media);
+ if (media.url != null)
+ list.append (media);
} catch (OSDatabaseError error) {
debug ("Failed to find OS with id: '%s': %s", os_id, error.message);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]