texture: Fix an oversight

construct-only properties also get set at construct time,
so we need to handle NULL here, until all our texture construction
methods pass a color state.
This commit is contained in:
Matthias Clasen
2024-06-24 07:39:36 -04:00
parent ca6fe07b27
commit 3f8076a085

View File

@@ -287,7 +287,10 @@ gdk_texture_set_property (GObject *gobject,
case PROP_COLOR_STATE:
if (self->color_state)
gdk_color_state_unref (self->color_state);
self->color_state = gdk_color_state_ref (g_value_get_boxed (value));
if (g_value_get_boxed (value))
self->color_state = gdk_color_state_ref (g_value_get_boxed (value));
else
self->color_state = GDK_COLOR_STATE_SRGB;
break;
default: