[gnome-initial-setup: 1/2] gis-driver: Avoid a warning about connecting to a NULL object
- From: Will Thompson <wjt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-initial-setup: 1/2] gis-driver: Avoid a warning about connecting to a NULL object
- Date: Mon, 24 Aug 2020 10:29:35 +0000 (UTC)
commit 8663ff104b9e900fc182d77b886f5d9902bb575d
Author: Philip Withnall <withnall endlessm com>
Date: Mon Aug 17 18:09:57 2020 +0100
gis-driver: Avoid a warning about connecting to a NULL object
`gdk_screen_get_default()` is not guaranteed to return a result.
In some circumstances (doesn’t matter which) it can return `NULL`.
Connecting to a signal on a `NULL` object emits a warning; avoid that.
Signed-off-by: Philip Withnall <withnall endlessm com>
gnome-initial-setup/gis-driver.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gnome-initial-setup/gis-driver.c b/gnome-initial-setup/gis-driver.c
index f6f9a049..2332aee0 100644
--- a/gnome-initial-setup/gis-driver.c
+++ b/gnome-initial-setup/gis-driver.c
@@ -927,8 +927,9 @@ gis_driver_init (GisDriver *driver)
load_vendor_conf_file (driver);
- g_signal_connect (screen, "size-changed",
- G_CALLBACK (screen_size_changed), driver);
+ if (screen != NULL)
+ g_signal_connect (screen, "size-changed",
+ G_CALLBACK (screen_size_changed), driver);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]