]> saetta.ns0.it Git - zakform/cgi/commitdiff
In binding if the value is null, value is setted as empty string.
authorAndrea Zagli <azagli@libero.it>
Sun, 25 Jun 2017 11:05:15 +0000 (13:05 +0200)
committerAndrea Zagli <azagli@libero.it>
Sun, 25 Jun 2017 11:05:15 +0000 (13:05 +0200)
src/form.c

index e3163ed0b83f735145692c4eb384ca7f2de85d56..5bcfa6cbee8c8ad77bd9a9129eb2b61547bdce80 100644 (file)
@@ -22,6 +22,8 @@
 
 #include <glib/gi18n-lib.h>
 
+#include <libzakutils/libzakutils.h>
+
 #include "form.h"
 #include "formelementstring.h"
 
@@ -195,10 +197,11 @@ _zak_form_cgi_form_bind (ZakFormCgiFormPrivate *priv, ZakFormCgiFormElement *ele
        if (id != NULL)
                {
                        gval = zak_cgi_main_get_stdin_field (priv->zakcgimain, id);
-                       if (gval != NULL)
+                       if (gval == NULL)
                                {
-                                       zak_form_cgi_form_element_bind (element, gval);
+                                       gval = zak_utils_gvalue_new_string ("");
                                }
+                       zak_form_cgi_form_element_bind (element, gval);
                        g_free (id);
                }
        else