From d8ecd07f9fcd1a21b3482213b5c87c218f7b2be2 Mon Sep 17 00:00:00 2001 From: Sebastian Wick Date: Wed, 7 Aug 2024 23:56:40 +0200 Subject: [PATCH] clutter/color-state: Allow comparing NULL color states Part-of: --- clutter/clutter/clutter-color-state.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/clutter/clutter/clutter-color-state.c b/clutter/clutter/clutter-color-state.c index 65c9fbf12..d6dec5075 100644 --- a/clutter/clutter/clutter-color-state.c +++ b/clutter/clutter/clutter-color-state.c @@ -843,12 +843,15 @@ clutter_color_state_equals (ClutterColorState *color_state, ClutterColorStatePrivate *priv; ClutterColorStatePrivate *other_priv; - g_return_val_if_fail (CLUTTER_IS_COLOR_STATE (color_state), FALSE); - g_return_val_if_fail (CLUTTER_IS_COLOR_STATE (other_color_state), FALSE); - if (color_state == other_color_state) return TRUE; + if (color_state == NULL || other_color_state == NULL) + return FALSE; + + g_return_val_if_fail (CLUTTER_IS_COLOR_STATE (color_state), FALSE); + g_return_val_if_fail (CLUTTER_IS_COLOR_STATE (other_color_state), FALSE); + priv = clutter_color_state_get_instance_private (color_state); other_priv = clutter_color_state_get_instance_private (other_color_state);