aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ephy-net-monitor.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/ephy-net-monitor.c b/src/ephy-net-monitor.c
index 0c2ac9a02..03f1edc25 100644
--- a/src/ephy-net-monitor.c
+++ b/src/ephy-net-monitor.c
@@ -111,6 +111,8 @@ ephy_net_monitor_check_network (EphyNetMonitor *monitor)
DBusMessage *message;
DBusPendingCall* reply;
+ if (priv->bus == NULL) return;
+
LOG ("EphyNetMonitor checking network");
/* ask to Network Manager if there is at least one active device */
@@ -248,13 +250,16 @@ ephy_net_monitor_startup (EphyNetMonitor *monitor)
ephy_net_monitor_attach_to_dbus (monitor);
- /* DBUS may disconnect us at any time. So listen carefully to it */
- g_signal_connect (dbus, "connected",
- G_CALLBACK (connect_to_system_bus_cb), monitor);
- g_signal_connect (dbus, "disconnected",
- G_CALLBACK (disconnect_from_system_bus_cb), monitor);
+ if (monitor->priv->bus != NULL)
+ {
+ /* DBUS may disconnect us at any time. So listen carefully to it */
+ g_signal_connect (dbus, "connected",
+ G_CALLBACK (connect_to_system_bus_cb), monitor);
+ g_signal_connect (dbus, "disconnected",
+ G_CALLBACK (disconnect_from_system_bus_cb), monitor);
- ephy_net_monitor_check_network (monitor);
+ ephy_net_monitor_check_network (monitor);
+ }
}
static void