mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-28 23:32:41 +00:00
SpaceDetailPresenter: Avoid crash on iPad when the source view is nil.
This commit is contained in:
parent
c62470bc3c
commit
eb2daaf684
1 changed files with 2 additions and 1 deletions
|
@ -98,7 +98,8 @@ class SpaceDetailPresenter: NSObject {
|
|||
} else {
|
||||
// Configure source view when view controller is presented with a popover
|
||||
viewController.modalPresentationStyle = .popover
|
||||
if let sourceView = self.sourceView, let popoverPresentationController = viewController.popoverPresentationController {
|
||||
if let popoverPresentationController = viewController.popoverPresentationController, let sourceView = sourceView ?? viewController.view {
|
||||
|
||||
popoverPresentationController.sourceView = sourceView
|
||||
popoverPresentationController.sourceRect = sourceView.bounds
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue