From 963ce72b0692030eaa00d4adb9022abd90716650 Mon Sep 17 00:00:00 2001 From: wade-hawk Date: Mon, 27 Jan 2020 16:09:44 +0900 Subject: [PATCH] Bug Fixed #236 --- TLPhotoPicker/Classes/TLPhotosPickerViewController.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/TLPhotoPicker/Classes/TLPhotosPickerViewController.swift b/TLPhotoPicker/Classes/TLPhotosPickerViewController.swift index 77d0362b..310fa5a9 100644 --- a/TLPhotoPicker/Classes/TLPhotosPickerViewController.swift +++ b/TLPhotoPicker/Classes/TLPhotosPickerViewController.swift @@ -305,9 +305,10 @@ open class TLPhotosPickerViewController: UIViewController { } if var index = self.focusedCollection?.fetchResult?.index(of: phAsset), + let focused = self.focusedCollection, index != NSNotFound { - index += (getfocusedIndex() == 0 && self.configure.usedCameraButton) ? 1 : 0 + index += (focused.useCameraButton) ? 1 : 0 self.collectionView.reloadItems(at: [IndexPath(row: index, section: 0)]) } }