1
0
Fork 0

clutter/transition: Do not call methods of a NULL ClutterAnimatable

Only call clutter_animatable_get_actor on a non-null object, otherwise set
the timeline actor to NULL directly.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3750>
This commit is contained in:
Corentin Noël 2024-05-14 15:43:52 +02:00 committed by Marge Bot
parent 1f1538be76
commit 0ab5ff6eed

View file

@ -355,7 +355,7 @@ clutter_transition_set_animatable (ClutterTransition *transition,
ClutterAnimatable *animatable)
{
ClutterTransitionPrivate *priv;
ClutterActor *actor;
ClutterActor *actor = NULL;
g_return_if_fail (CLUTTER_IS_TRANSITION (transition));
g_return_if_fail (animatable == NULL || CLUTTER_IS_ANIMATABLE (animatable));
@ -374,9 +374,9 @@ clutter_transition_set_animatable (ClutterTransition *transition,
{
priv->animatable = g_object_ref (animatable);
clutter_transition_attach (transition, priv->animatable);
actor = clutter_animatable_get_actor (animatable);
}
actor = clutter_animatable_get_actor (animatable);
clutter_timeline_set_actor (CLUTTER_TIMELINE (transition), actor);
}