YPImagePicker
YPImagePicker copied to clipboard
App Crashes when Changing Selected Image
Is your feature request related to a problem? Please describe. When you deselect a selected image and select another without confirming the new image by tapping it the app crashes e.g. Image is selected, you deselect the image and select another, tap done, app crashes YPImagePicker/YPLibraryVC.swift:531: Fatal error: Unexpectedly found nil while unwrapping an Optional value
Describe the solution you'd like safely unwrap variables
Additional context https://github.com/Yummypets/YPImagePicker/blob/beed49d4ac6f2a8fe260d461992b365c5e9eaf4f/Source/Pages/Gallery/YPLibraryVC.swift#L531

I am getting the same error but slightly different steps to reproduce.
1.) Open picker and observe that the first image in the library is highlighted and seems selected. 2.) Without clicking any other photo press "Done" in the top right 3.) App Crashes with the error above and "selectedAssets" has 0 values upon breakpoint inspection
Describe the solution you'd like
- selectedAssets.first should default to the first photo in the users library upon opening the picker