[Xfce4-commits] <xfconf:master> Accept NULL as a string value (bug #8726).

Nick Schermer noreply at xfce.org
Thu Apr 19 19:28:01 CEST 2012


Updating branch refs/heads/master
         to 1ac55249cb4981ca4169ffb99cf9c5c96b19ca29 (commit)
       from f206c1da605d4a8a1c8a136d4a367a51fc3a5629 (commit)

commit 1ac55249cb4981ca4169ffb99cf9c5c96b19ca29
Author: Nick Schermer <nick at xfce.org>
Date:   Thu Apr 19 19:25:56 2012 +0200

    Accept NULL as a string value (bug #8726).
    
    The new utf8 checks were aborting, while null is a
    valid value for strings.

 xfconf/xfconf-channel.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xfconf/xfconf-channel.c b/xfconf/xfconf-channel.c
index 546db3b..b44b1da 100644
--- a/xfconf/xfconf-channel.c
+++ b/xfconf/xfconf-channel.c
@@ -1019,7 +1019,7 @@ xfconf_channel_set_string(XfconfChannel *channel,
     gboolean ret;
 
     g_return_val_if_fail(XFCONF_IS_CHANNEL(channel) && property, FALSE);
-    g_return_val_if_fail(g_utf8_validate(value, -1, NULL), FALSE);
+    g_return_val_if_fail(value == NULL || g_utf8_validate(value, -1, NULL), FALSE);
 
     g_value_init(&val, G_TYPE_STRING);
     g_value_set_static_string(&val, value);
@@ -1325,6 +1325,7 @@ xfconf_channel_set_property(XfconfChannel *channel,
                          && property
                          && G_IS_VALUE(value), FALSE);
     g_return_val_if_fail(!G_VALUE_HOLDS_STRING(value)
+                         || g_value_get_string(value) == NULL
                          || g_utf8_validate(g_value_get_string(value), -1, NULL),
                          FALSE);
 


More information about the Xfce4-commits mailing list