[gupnp] Check for system bus before using DBus



commit dd6008cdba08e2f1fe8bb97946c6515a355dd56a
Author: Jens Georg <mail jensge org>
Date:   Sat May 10 18:35:53 2014 +0200

    Check for system bus before using DBus
    
    If there's no system bus, there's no need to check for Connman or
    NetworkManager availability.
    
    Signed-off-by: Jens Georg <mail jensge org>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=727709

 libgupnp/gupnp-context-manager.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/libgupnp/gupnp-context-manager.c b/libgupnp/gupnp-context-manager.c
index 31b711b..4132d4b 100644
--- a/libgupnp/gupnp-context-manager.c
+++ b/libgupnp/gupnp-context-manager.c
@@ -552,12 +552,12 @@ gupnp_context_manager_create (guint port)
 #if defined(USE_NETWORK_MANAGER)
         system_bus = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, NULL);
 
-        if (gupnp_network_manager_is_available ())
+        if (system_bus != NULL && gupnp_network_manager_is_available ())
                 impl_type = GUPNP_TYPE_NETWORK_MANAGER;
 #elif defined(USE_CONNMAN)
         system_bus = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, NULL);
 
-       if (gupnp_connman_manager_is_available ())
+       if (system_bus != NULL && gupnp_connman_manager_is_available ())
                 impl_type = GUPNP_TYPE_CONNMAN_MANAGER;
 #endif
 


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