summaryrefslogtreecommitdiff
path: root/gnome-extra/gnome-boxes/files/gnome-boxes-45.0-c99.patch
blob: a58797b44ece0bd1a6ec0fdd1272f5b2737c83e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
https://bugs.gentoo.org/936516
https://gitlab.gnome.org/GNOME/gnome-boxes/-/merge_requests/648

From 00183fd26a7b51905c179a427a38bfa18d9eb2d3 Mon Sep 17 00:00:00 2001
From: sid <sidtosh4@gmail.com>
Date: Wed, 22 May 2024 19:32:06 +0100
Subject: [PATCH] libvirt-broker: Check when broker is not valid

Related: #863
--- a/src/libvirt-broker.vala
+++ b/src/libvirt-broker.vala
@@ -24,9 +24,10 @@ public GVir.Connection get_connection (string name) {
         return broker.connections.get (name);
     }
 
-    public async LibvirtMachine add_domain (CollectionSource source, GVir.Connection connection, GVir.Domain domain)
-                                            throws GLib.Error {
-        return_val_if_fail (broker != null, null);
+    public async LibvirtMachine? add_domain (CollectionSource source, GVir.Connection connection, GVir.Domain domain)
+                                             throws GLib.Error {
+        if (broker == null)
+            return null;
 
         if (pending_domains.find (domain) != null) {
             // Already being added asychronously
-- 
GitLab