diff options
author | Matthias Clasen <mclasen@redhat.com> | 2022-09-24 20:21:07 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2022-09-24 20:26:50 -0400 |
commit | 241286a23b2dc7ff97b274fe991bf4028a3d1b95 (patch) | |
tree | 66af49afb97efe52c679d00d4dec43c947bcc724 | |
parent | d2818c2033d8f82b001665c097d6c7e715b3ed8a (diff) | |
download | glib-fix-param-validation.tar.gz |
Fix g_param_is_valid for GParamfix-param-validation
The is_valid vfunc need to return the same
condition that the validate vfunc uses to
determine whether to 'fix' the value.
param_param_validate is considering NULL to
be a valid value, so param_param_is_valid needs
to do the same.
Fixes: #8576
-rw-r--r-- | gobject/gparamspecs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gobject/gparamspecs.c b/gobject/gparamspecs.c index f17b3488b..c3e4e446a 100644 --- a/gobject/gparamspecs.c +++ b/gobject/gparamspecs.c @@ -894,7 +894,7 @@ param_param_is_valid (GParamSpec *pspec, { GParamSpec *param = value->data[0].v_pointer; - return g_value_type_compatible (G_PARAM_SPEC_TYPE (param), G_PARAM_SPEC_VALUE_TYPE (pspec)); + return !param || g_value_type_compatible (G_PARAM_SPEC_TYPE (param), G_PARAM_SPEC_VALUE_TYPE (pspec)); } static gboolean |