aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-10-04 18:35:57 +0200
committerAleksander Morgado <aleksander@lanedo.com>2012-10-04 18:53:00 +0200
commit9e16aeb6bfc097c59e3dfc8932c21353e00f73c1 (patch)
tree800315eafba22f64daec77b56b29bc9c0c5e53e8
parenta27fd5a47bbb7842712cf228184148b5158dea8b (diff)
libmm-glib: fix firmware list result parsing
-rw-r--r--libmm-glib/mm-modem-firmware.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libmm-glib/mm-modem-firmware.c b/libmm-glib/mm-modem-firmware.c
index 96f74951..c52f3160 100644
--- a/libmm-glib/mm-modem-firmware.c
+++ b/libmm-glib/mm-modem-firmware.c
@@ -182,7 +182,7 @@ build_results (const gchar *str_selected,
*selected = NULL;
if (!dictionaries_installed) {
- if (str_selected) {
+ if (str_selected && str_selected[0]) {
g_set_error (error,
MM_CORE_ERROR,
MM_CORE_ERROR_INVALID_ARGS,
@@ -201,7 +201,7 @@ build_results (const gchar *str_selected,
if (n > 0) {
GVariant *dictionary = NULL;
- while (g_variant_iter_loop (&iter, "a{sv}", &dictionary)) {
+ while ((dictionary = g_variant_iter_next_value (&iter))) {
MMFirmwareProperties *firmware;
GError *inner_error = NULL;
@@ -217,14 +217,16 @@ build_results (const gchar *str_selected,
/* Save the firmware properties */
*installed = g_list_append (*installed, firmware);
- if (str_selected &&
+ if (str_selected && str_selected[0] &&
g_str_equal (mm_firmware_properties_get_unique_id (firmware), str_selected))
*selected = g_object_ref (firmware);
}
+
+ g_variant_unref (dictionary);
}
}
- if (str_selected && *selected == NULL)
+ if (str_selected && str_selected[0] && *selected == NULL)
g_warning ("Selected image '%s' was not found in the list of installed images",
str_selected);