Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value

Hi! I get this error when I complete writing chapter 20 and run it.

Sucessfully found 44 photos.

Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value

2019-08-23 14:41:37.907047+0900 Photorama[695:38793] Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value

and I get remark on self .imageView.image = image.
It looks like source data includes nil image. Below code included in PhotosViewController.swift

func updateImageView(for photo: Photo) {
    store.fetchImage(for: photo) {
        (imageResult) -> Void in
        switch imageResult {
        case let .success(image):
            ***self .imageView.image = image***
        case let .failure(error):
            print("Error downloading image: \(error)")
        }

How I could solve this error?

Make sure that image does not contain a nil value first.

if (image != nil) {
    self .imageView.image = image
}

Thanks for response. It has the same error. so I changed code like below and found out

38 nil photos.

func updateImageView(for photo: Photo) {
self.store.fetchImage(for: photo) {
(imageResult) -> Void in

        switch imageResult {
        case let .success(image):
            OperationQueue.main.addOperation {
                if **(image == nil)** {
                
                    self.imageView.image = image
                    
                }
            }
           
        case let .failure(error):
            print("Error downloading image: \(error)")
        }

Could I remove nil 38 photos from photo array? How?

Sorry I don’t have the book, but I can help if you post your code here or send it to me via Pretty Function (Learn Coding).