From 4986bb09a9e3a40d6ad6762bab5a520b94c7f1c9 Mon Sep 17 00:00:00 2001 From: Kyle Matthew Hedden Date: Mon, 21 Sep 2020 16:11:58 -0400 Subject: [PATCH] Add array protectioons. --- MVMCoreUI/TopAlert/MVMCoreUITopAlertExpandableView.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/MVMCoreUI/TopAlert/MVMCoreUITopAlertExpandableView.m b/MVMCoreUI/TopAlert/MVMCoreUITopAlertExpandableView.m index e0eef9d6..9a1d3099 100644 --- a/MVMCoreUI/TopAlert/MVMCoreUITopAlertExpandableView.m +++ b/MVMCoreUI/TopAlert/MVMCoreUITopAlertExpandableView.m @@ -393,8 +393,12 @@ weakSelf.buttonView.label.alpha = 0; weakSelf.shortViewHeight.active = NO; } completion:^(BOOL finished) { - [weakSelf.viewToLayout layoutIfNeeded]; - weakSelf.accessibilityElements = @[weakSelf.shortView.label]; + typeof(self) strongSelf = weakSelf; + if (!strongSelf) { + return; + } + [strongSelf.viewToLayout layoutIfNeeded]; + strongSelf.accessibilityElements = @[strongSelf.shortView.label]; UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification, nil); [MVMCoreDispatchUtility performBlockInBackground:^{ // Must notify animation delegate when animating finished.