Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -516,9 +516,14 @@ - (void)dismissCurrentInAppMessage:(BOOL)up withVelocity:(double)velocity {
if (self.dismissalTimer)
[self.dismissalTimer invalidate];

// If the rendering event never occurs any constraints being adjusted for dismissal will be nil
// and we should bypass dismissal adjustments and animations and skip straight to the OSMessagingController callback for dismissing
if (!self.didPageRenderingComplete) {
// Return early and skip constraint adjustments/animations if:
// - Page rendering never completed (constraints would be nil)
// - messageView is not valid or not a direct subview of self.view (prevents crashes when
// dismissal is triggered while the view hierarchy is in an inconsistent state)
if (!self.didPageRenderingComplete ||
!self.messageView ||
self.messageView.superview != self.view)
{
[self dismissViewControllerAnimated:false completion:nil];
[self.delegate messageViewControllerWasDismissed:self.message displayed:NO];
return;
Expand Down
Loading