YPImagePicker icon indicating copy to clipboard operation
YPImagePicker copied to clipboard

App Crashes when Changing Selected Image

Open wkwyatt opened this issue 2 years ago • 1 comments

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

Screen Shot 2022-09-28 at 7 56 32 PM

Screen Shot 2022-09-28 at 7 59 16 PM

Simulator Screen Shot - iPhone 13 - 2022-09-28 at 19 53 39

Simulator Screen Shot - iPhone 13 - 2022-09-28 at 19 53 45

Simulator Screen Shot - iPhone 13 - 2022-09-28 at 19 53 52

Screen Shot 2022-09-28 at 7 56 32 PM

wkwyatt avatar Sep 29 '22 00:09 wkwyatt

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

AdlerJS avatar Oct 25 '22 13:10 AdlerJS