mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-05-05 08:48:05 +02:00
Prevent segementation fault, if connection to system dbus fails
Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
This commit is contained in:
parent
bbb102c394
commit
725acd4d35
1 changed files with 6 additions and 1 deletions
|
|
@ -129,6 +129,8 @@ dkp_client_enumerate_devices_private (DkpClient *client, GError **error)
|
|||
GPtrArray *devices = NULL;
|
||||
GType g_type_array;
|
||||
|
||||
if (!client->priv->proxy)
|
||||
return NULL;
|
||||
g_type_array = dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_OBJECT_PATH);
|
||||
ret = dbus_g_proxy_call (client->priv->proxy, "EnumerateDevices", &error_local,
|
||||
G_TYPE_INVALID,
|
||||
|
|
@ -240,6 +242,8 @@ dkp_client_ensure_properties (DkpClient *client)
|
|||
|
||||
if (client->priv->have_properties)
|
||||
goto out;
|
||||
if (!client->priv->prop_proxy)
|
||||
goto out;
|
||||
|
||||
error = NULL;
|
||||
ret = dbus_g_proxy_call (client->priv->prop_proxy, "GetAll", &error,
|
||||
|
|
@ -711,7 +715,8 @@ dkp_client_finalize (GObject *object)
|
|||
|
||||
g_hash_table_destroy (client->priv->hash);
|
||||
|
||||
dbus_g_connection_unref (client->priv->bus);
|
||||
if (client->priv->bus)
|
||||
dbus_g_connection_unref (client->priv->bus);
|
||||
|
||||
if (client->priv->proxy != NULL)
|
||||
g_object_unref (client->priv->proxy);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue