From aca4365e8d703e5cfaaa66e2789933df48be5cd7 Mon Sep 17 00:00:00 2001 From: John Colvin Date: Thu, 26 May 2022 16:03:40 -0400 Subject: [PATCH] fix (pre-emptive): Add null check --- src/client/spark/view/Utility/ExpandCollapseAnimator.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 ?