mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-02 17:26:17 +01:00
Empty values are not valid GParamSpec
The validate() vfunc for GParamSpecParam returns FALSE for empty GValue, which means the is_valid() vfunc should do the same. This avoids a segfault when calling g_param_value_is_valid() on a GParamSpecParam. Fixes: #2770
This commit is contained in:
parent
d2818c2033
commit
ea3f17d598
@ -894,6 +894,9 @@ param_param_is_valid (GParamSpec *pspec,
|
|||||||
{
|
{
|
||||||
GParamSpec *param = value->data[0].v_pointer;
|
GParamSpec *param = value->data[0].v_pointer;
|
||||||
|
|
||||||
|
if (param == NULL)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
return g_value_type_compatible (G_PARAM_SPEC_TYPE (param), G_PARAM_SPEC_VALUE_TYPE (pspec));
|
return g_value_type_compatible (G_PARAM_SPEC_TYPE (param), G_PARAM_SPEC_VALUE_TYPE (pspec));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user