aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--src/ephy-net-monitor.c17
2 files changed, 19 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 627d9a4a2..a93123ddc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-03-04 Christian Persch <chpe@svn.gnome.org>
+
+ * src/ephy-net-monitor.c: (ephy_net_monitor_check_network),
+ (ephy_net_monitor_startup):
+
+ Don't crash when we cannot access the system bus. Bug #404514, patch
+ by Jan de Groot.
+
2007-03-03 Christian Persch <chpe@svn.gnome.org>
* embed/Makefile.am:
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