wordpress-mobile / MediaPicker-iOS

WPMediaPicker is an iOS controller that allows capture and picking of media assets.
GNU General Public License v2.0
110 stars 37 forks source link

Fix crash when displaying an empty view #409

Closed hassaanelgarem closed 1 year ago

hassaanelgarem commented 1 year ago

References

Description

If the media picker delegate implements the emptyViewController function but ends up returning nil, this results in a crash. This PR makes sure that the empty view controller is always set, even if the delegate returns nil.

Testing Details

Please test using the referenced WPiOS PR.


staskus commented 1 year ago

Unfortunately, it caused WPMediaPickerViewController crash: NSInternalInconsistencyException: Invalid batch updates detected, we'll need to revert or adjust these changes.