aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-net-monitor.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2006-04-03 19:56:01 +0800
committerChristian Persch <chpe@src.gnome.org>2006-04-03 19:56:01 +0800
commitd25608d94a39a9bbb5ec4770e1da6b68d420bb5b (patch)
treec2935a5a4663685f1d7397a652c783028cee4762 /src/ephy-net-monitor.c
parent64d66e03766ff4a529f2ebca534dbbcd756452a2 (diff)
downloadgsoc2013-epiphany-d25608d94a39a9bbb5ec4770e1da6b68d420bb5b.tar
gsoc2013-epiphany-d25608d94a39a9bbb5ec4770e1da6b68d420bb5b.tar.gz
gsoc2013-epiphany-d25608d94a39a9bbb5ec4770e1da6b68d420bb5b.tar.bz2
gsoc2013-epiphany-d25608d94a39a9bbb5ec4770e1da6b68d420bb5b.tar.lz
gsoc2013-epiphany-d25608d94a39a9bbb5ec4770e1da6b68d420bb5b.tar.xz
gsoc2013-epiphany-d25608d94a39a9bbb5ec4770e1da6b68d420bb5b.tar.zst
gsoc2013-epiphany-d25608d94a39a9bbb5ec4770e1da6b68d420bb5b.zip
Don't crash when we cannot connect to the system dbus. Bug #336557.
2006-04-03 Christian Persch <chpe@cvs.gnome.org> * src/ephy-dbus.c: (ephy_dbus_get_bus): * src/ephy-net-monitor.c: (ephy_net_monitor_check_for_active_device), (ephy_net_monitor_attach_to_dbus), (ephy_net_monitor_startup): Don't crash when we cannot connect to the system dbus. Bug #336557.
Diffstat (limited to 'src/ephy-net-monitor.c')
-rw-r--r--src/ephy-net-monitor.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ephy-net-monitor.c b/src/ephy-net-monitor.c
index df550bb5e..a087d151c 100644
--- a/src/ephy-net-monitor.c
+++ b/src/ephy-net-monitor.c
@@ -103,6 +103,8 @@ ephy_net_monitor_check_for_active_device (EphyNetMonitor *monitor,
NMActStage act_stage = NM_ACT_STAGE_UNKNOWN;
NetworkStatus status = NETWORK_DOWN;
+ if (priv->bus == NULL) return NETWORK_UP;
+
for (i = 0; i < num; i++)
{
const char *path = all_path [i];
@@ -338,7 +340,7 @@ ephy_net_monitor_attach_to_dbus (EphyNetMonitor *monitor)
dbus = ephy_dbus_get_default ();
g_connection = ephy_dbus_get_bus (dbus, EPHY_DBUS_SYSTEM);
- g_return_if_fail (g_connection != NULL);
+ if (g_connection == NULL) return;
priv->bus = dbus_g_connection_get_connection (g_connection);
@@ -408,7 +410,6 @@ ephy_net_monitor_startup (EphyNetMonitor *monitor)
g_signal_connect (dbus, "disconnected",
G_CALLBACK (disconnect_from_system_bus_cb), monitor);
- /* FIXME what if the system bus isn't available right now? */
ephy_net_monitor_check_network (monitor);
}