mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-09 19:06:15 +01:00
Check for empty property name in GPropertyAction
Make sure to fail consistently in case people created a GPropertyAction with g_object_new() without passing a property name. Bindings that construct objects with g_object_new() have no idea if a property is mandatory. See: #3130
This commit is contained in:
parent
525508be0d
commit
3a2af81ced
@ -313,6 +313,15 @@ g_property_action_set_property_name (GPropertyAction *paction,
|
||||
GParamSpec *pspec;
|
||||
gchar *detailed;
|
||||
|
||||
/* In case somebody is constructing GPropertyAction without passing
|
||||
* a property name
|
||||
*/
|
||||
if (G_UNLIKELY (property_name == NULL || property_name[0] == '\0'))
|
||||
{
|
||||
g_critical ("Attempted to use an empty property name for GPropertyAction");
|
||||
return;
|
||||
}
|
||||
|
||||
pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (paction->object), property_name);
|
||||
|
||||
if (pspec == NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user