[gnome-color-manager] trivial: only copy the profiles from the target device if there are profiles to copy
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-color-manager] trivial: only copy the profiles from the target device if there are profiles to copy
- Date: Wed, 26 May 2010 16:33:46 +0000 (UTC)
commit b19f09598b1b3d5800bc3420277d14f8fc680345
Author: Richard Hughes <richard hughsie com>
Date: Wed May 26 16:12:31 2010 +0100
trivial: only copy the profiles from the target device if there are profiles to copy
src/gcm-client.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/gcm-client.c b/src/gcm-client.c
index dc395b4..e7b00da 100644
--- a/src/gcm-client.c
+++ b/src/gcm-client.c
@@ -1155,6 +1155,7 @@ gcm_client_add_device (GcmClient *client, GcmDevice *device, GError **error)
gboolean ret = FALSE;
const gchar *device_id;
GcmDevice *device_tmp = NULL;
+ GPtrArray *array;
g_return_val_if_fail (GCM_IS_CLIENT (client), FALSE);
g_return_val_if_fail (GCM_IS_DEVICE (device), FALSE);
@@ -1164,7 +1165,9 @@ gcm_client_add_device (GcmClient *client, GcmDevice *device, GError **error)
device_tmp = gcm_client_get_device_by_id (client, device_id);
if (device_tmp != NULL) {
egg_debug ("already exists, copy settings and remove old device: %s", device_id);
- gcm_device_set_profiles (device, gcm_device_get_profiles (device_tmp));
+ array = gcm_device_get_profiles (device_tmp);
+ if (array != NULL)
+ gcm_device_set_profiles (device, array);
gcm_device_set_saved (device, gcm_device_get_saved (device_tmp));
ret = gcm_client_remove_device_internal (client, device_tmp, FALSE, error);
if (!ret)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]