Fix g_param_is_valid for GParam

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
This commit is contained in:
Matthias Clasen 2022-09-24 20:21:07 -04:00
parent d2818c2033
commit 241286a23b

View File

@ -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