summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Georg <mail@jensge.org>2014-05-10 18:35:53 +0200
committerJens Georg <mail@jensge.org>2014-05-10 18:38:17 +0200
commitdd6008cdba08e2f1fe8bb97946c6515a355dd56a (patch)
tree6f5d76b933deab49e4e1059b308b641b060a3bf2
parent7507049677411547eed506ea76eb33539cb414e5 (diff)
downloadgupnp-dd6008cdba08e2f1fe8bb97946c6515a355dd56a.tar.gz
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
-rw-r--r--libgupnp/gupnp-context-manager.c4
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