ifcfg-rh: fix crash when system bus isn't around
authorDan Williams <dcbw@redhat.com>
Mon, 19 Sep 2011 22:38:58 +0000 (17:38 -0500)
committerDan Williams <dcbw@redhat.com>
Mon, 19 Sep 2011 22:38:58 +0000 (17:38 -0500)
src/settings/plugins/ifcfg-rh/plugin.c

index ed0dcec..b4be4cb 100644 (file)
@@ -655,8 +655,10 @@ sc_plugin_ifcfg_init (SCPluginIfcfg *plugin)
        }
 
        if (!success) {
-               dbus_g_connection_unref (priv->bus);
-               priv->bus = NULL;
+               if (priv->bus) {
+                       dbus_g_connection_unref (priv->bus);
+                       priv->bus = NULL;
+               }
        }
 }