mirror of
https://github.com/mastodon/mastodon-ios.git
synced 2025-02-01 01:46:55 +01:00
fix: dismiss image may crash issue due to source view gone
This commit is contained in:
parent
20b3bed99f
commit
ae58230581
@ -18,9 +18,9 @@ extension MediaPreviewableViewController {
|
||||
case .mosaic(let mosaicImageViewContainer):
|
||||
guard index < mosaicImageViewContainer.imageViews.count else { return nil }
|
||||
let imageView = mosaicImageViewContainer.imageViews[index]
|
||||
return imageView.superview!.convert(imageView.frame, to: nil)
|
||||
return imageView.superview?.convert(imageView.frame, to: nil)
|
||||
case .profileAvatar(let profileHeaderView):
|
||||
return profileHeaderView.avatarImageView.superview!.convert(profileHeaderView.avatarImageView.frame, to: nil)
|
||||
return profileHeaderView.avatarImageView.superview?.convert(profileHeaderView.avatarImageView.frame, to: nil)
|
||||
case .profileBanner:
|
||||
return nil // fallback to snapshot.frame
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user