KenBurns icon indicating copy to clipboard operation
KenBurns copied to clipboard

fun queueNextImage -> Fatal error: Unexpectedly found nil while unwrapping an Optional value: file

Open steve111MV opened this issue 4 years ago • 1 comments

Fatal error: Unexpectedly found nil while unwrapping an Optional value: file Pods/KenBurns/KenBurns/Classes/KenBurns.swift, line 327

I'm not using a Queue but the library is trying to load a next image from the queue. in the following line 327

func queueNextImage() {
        if remoteQueue  { 
            if imagePlaceholders == nil {
                nextImageView.kf.setImage(with: imageURLs!.read()!, placeholder: nil, options: [.transition(.fade(0.2))])
                nextImageView.kf.indicatorType = .activity
            } else {
                nextImageView.kf.setImage(with: imageURLs!.read()!, placeholder: nil, options: [.transition(.fade(0.2))])
                nextImageView.kf.indicatorType = .activity
            }
        } else {
            nextImageView.image = imageQueue!.read() //Line 327
        }
    }

steve111MV avatar Jul 03 '20 16:07 steve111MV

You can just add a guard in the meantime

guard let queue = imageQueue else { nextImageView.image = currentImageView.image return }

paxi-ml avatar Sep 15 '20 00:09 paxi-ml