diff options
author | Christian Persch <chpe@svn.gnome.org> | 2007-03-04 22:45:24 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2007-03-04 22:45:24 +0800 |
commit | 68fe5dcec691aa13dbc7ee5fa8768c11cfa6cc53 (patch) | |
tree | 5f27f3ca49541e847bfca13cf454ea3bbc6172b8 /src/ephy-net-monitor.c | |
parent | 6c82a6f714fd2ddc08a37778a0aac7a6e2b9bbbe (diff) | |
download | gsoc2013-epiphany-68fe5dcec691aa13dbc7ee5fa8768c11cfa6cc53.tar gsoc2013-epiphany-68fe5dcec691aa13dbc7ee5fa8768c11cfa6cc53.tar.gz gsoc2013-epiphany-68fe5dcec691aa13dbc7ee5fa8768c11cfa6cc53.tar.bz2 gsoc2013-epiphany-68fe5dcec691aa13dbc7ee5fa8768c11cfa6cc53.tar.lz gsoc2013-epiphany-68fe5dcec691aa13dbc7ee5fa8768c11cfa6cc53.tar.xz gsoc2013-epiphany-68fe5dcec691aa13dbc7ee5fa8768c11cfa6cc53.tar.zst gsoc2013-epiphany-68fe5dcec691aa13dbc7ee5fa8768c11cfa6cc53.zip |
Don't crash when we cannot access the system bus. Bug #404514, patch by
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.
svn path=/trunk/; revision=6935
Diffstat (limited to 'src/ephy-net-monitor.c')
-rw-r--r-- | src/ephy-net-monitor.c | 17 |
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 |