Commit d24fae0a authored by Milan Šťastný's avatar Milan Šťastný Committed by Alexander Mikhaylenko
Browse files

carousel: Null check child when scrolling

Fix a crash when scrolling in an empty carousel.
parent a6fa47fe
Pipeline #326077 passed with stages
in 5 minutes and 13 seconds
......@@ -379,9 +379,13 @@ scroll_to (AdwCarousel *self,
if (self->animation)
adw_animation_stop (self->animation);
self->animation_source_position = self->position;
self->animation_target_child = find_child_info (self, widget);
if (self->animation_target_child == NULL)
self->animation_source_position = self->position;
self->animation =
adw_animation_new (GTK_WIDGET (self), 0, 1, duration,
(AdwAnimationTargetFunc) scroll_animation_value_cb,
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment