Fix potential crash when large image loading fails

This commit is contained in:
Shadowfacts 2021-04-04 14:05:00 -04:00
parent a3b59c990b
commit 5f5ef8fcea
1 changed files with 2 additions and 2 deletions

View File

@ -94,11 +94,11 @@ class LoadingLargeImageViewController: UIViewController, LargeImageAnimatableVie
loadingVC = LoadingViewController()
embedChild(loadingVC!)
imageRequest = cache.get(url, loadOriginal: true) { [weak self] (data, image) in
guard let self = self else { return }
guard let self = self, let image = image else { return }
self.imageRequest = nil
DispatchQueue.main.async {
self.loadingVC?.removeViewAndController()
self.createLargeImage(data: data!, image: image!, url: self.url)
self.createLargeImage(data: data, image: image, url: self.url)
}
}
}