forked from AuroraMiddleware/gtk
border-image: don't try to unpack values from a NULL border-image
NULL is a valid value for border-image, so if it's NULL when unpacking, don't try to access the struct fields, but just init the GValues for the unpacked parameters.
This commit is contained in:
parent
fe7125e00c
commit
42d7487a6e
@ -139,15 +139,19 @@ _gtk_border_image_unpack (const GValue *value,
|
||||
|
||||
parameter[0].name = "border-image-source";
|
||||
g_value_init (¶meter[0].value, CAIRO_GOBJECT_TYPE_PATTERN);
|
||||
g_value_set_boxed (¶meter[0].value, image->source);
|
||||
|
||||
parameter[1].name = "border-image-slice";
|
||||
g_value_init (¶meter[1].value, GTK_TYPE_BORDER);
|
||||
g_value_set_boxed (¶meter[1].value, &image->slice);
|
||||
|
||||
parameter[2].name = "border-image-repeat";
|
||||
g_value_init (¶meter[2].value, GTK_TYPE_CSS_BORDER_IMAGE_REPEAT);
|
||||
g_value_set_boxed (¶meter[2].value, &image->repeat);
|
||||
|
||||
if (image != NULL)
|
||||
{
|
||||
g_value_set_boxed (¶meter[0].value, image->source);
|
||||
g_value_set_boxed (¶meter[1].value, &image->slice);
|
||||
g_value_set_boxed (¶meter[2].value, &image->repeat);
|
||||
}
|
||||
|
||||
*n_params = 3;
|
||||
return parameter;
|
||||
|
Loading…
Reference in New Issue
Block a user