]> saetta.ns0.it Git - zakform/libzakform/commitdiff
In FormElementArray setted value in any case.
authorAndrea Zagli <azagli@libero.it>
Sun, 25 Jun 2017 11:03:46 +0000 (13:03 +0200)
committerAndrea Zagli <azagli@libero.it>
Sun, 25 Jun 2017 11:03:46 +0000 (13:03 +0200)
src/formelementarray.c

index bb976a749bafd88bfe8926d6784dfc3d2bedbc4f..6c9b11f80a019a79a92a59730e6c8cf32028d505 100644 (file)
@@ -411,12 +411,15 @@ zak_form_element_array_set_value (ZakFormElementArray *element, GValue *value)
                                }
 
                        /* assign value to the right FormElement */
-                       if (field_name != NULL
-                               && field_value != NULL)
+                       if (field_name != NULL)
                                {
                                        form_element = zak_form_element_array_get_element_by_id (ZAK_FORM_ELEMENT (element), field_name);
                                        if (form_element != NULL)
                                                {
+                                                       if (field_value == NULL)
+                                                               {
+                                                                       field_value = zak_utils_gvalue_new_string ("");
+                                                               }
                                                        zak_form_element_set_value (ZAK_FORM_ELEMENT (form_element), field_value);
                                                }
                                }