From 8cc78c1ea106e6c8c19b3dc17a8c3fcf6cbe18a0 Mon Sep 17 00:00:00 2001 From: Andrea Zagli Date: Sun, 25 Jun 2017 13:05:15 +0200 Subject: [PATCH] In binding if the value is null, value is setted as empty string. --- src/form.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/form.c b/src/form.c index e3163ed..5bcfa6c 100644 --- a/src/form.c +++ b/src/form.c @@ -22,6 +22,8 @@ #include +#include + #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 -- 2.49.0