[glib/portal] portal support: handle errors



commit 4e7a7ace2316d9afa43dfe5c16db4435ee7810f1
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Jun 30 11:42:23 2016 -0400

    portal support: handle errors
    
    Return an error when we don't have a session bus connection.
    Pointed out by Cosimo and Mario.

 gio/gappinfo.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gio/gappinfo.c b/gio/gappinfo.c
index 0ea8051..51de5d6 100644
--- a/gio/gappinfo.c
+++ b/gio/gappinfo.c
@@ -680,7 +680,9 @@ launch_default_with_portal (const char         *uri,
   GVariantBuilder opt_builder;
   const char *parent_window = NULL;
 
-  bus = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL);
+  bus = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, error);
+  if (bus == NULL)
+    return FALSE;
 
   if (context)
     {


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