diff --git a/src/client/spark/view/Utility/ExpandCollapseAnimator.cs b/src/client/spark/view/Utility/ExpandCollapseAnimator.cs index fcd119792..0892bb2d4 100644 --- a/src/client/spark/view/Utility/ExpandCollapseAnimator.cs +++ b/src/client/spark/view/Utility/ExpandCollapseAnimator.cs @@ -37,7 +37,9 @@ namespace mbts.ui { } static void _animate(FrameworkElement content, DoubleAnimation? anim, bool is_expanded) { - var collapsible_container = content.find_ancestor_of_type(); + if (!content.try_find_ancestor_of_type(out ContentControl collapsible_container)) { + return; + } content.Measure(new(double.PositiveInfinity, double.PositiveInfinity)); var (from, to) = is_expanded ?