@@ -217,8 +217,6 @@ class MultipleImagePicker: NSObject, TLPhotosPickerViewControllerDelegate,UINavi
217217 }
218218
219219 func fetchAsset( TLAsset: TLPHAsset , completion: @escaping ( MediaResponse ) -> Void ) {
220- let index = TLAsset . selectedOrder - 1 ;
221-
222220 TLAsset . tempCopyMediaFile ( videoRequestOptions: self . videoRequestOptions, imageRequestOptions: self . imageRequestOptions, livePhotoRequestOptions: nil , exportPreset: AVAssetExportPresetHighestQuality, convertLivePhotosToJPG: true , progressBlock: { ( progress) in
223221 } , completionBlock: { ( filePath, fileType) in
224222
@@ -228,14 +226,13 @@ class MultipleImagePicker: NSObject, TLPhotosPickerViewControllerDelegate,UINavi
228226 completion ( object)
229227 }
230228 } )
231-
232229 }
233230
234231 func dismissPhotoPicker( withTLPHAssets: [ TLPHAsset ] ) {
235232
236233 // check with asset picker
237234 if ( withTLPHAssets. count == 0 ) {
238- self . resolve ( [ ] ) ;
235+ resolve ( [ ] ) ;
239236 dismissComplete ( )
240237 return ;
241238 }
@@ -281,16 +278,14 @@ class MultipleImagePicker: NSObject, TLPhotosPickerViewControllerDelegate,UINavi
281278 for TLAsset in withTLPHAssets {
282279 group. enter ( )
283280 self . fetchAsset ( TLAsset: TLAsset) { object in
284- // check nil object response
285- if ( object != nil ) {
286- selections [ index] = object as MediaResponse ;
287- }
281+ let index = TLAsset . selectedOrder - 1 ;
282+ selections [ index] = object. data as Any ;
288283 group. leave ( ) ;
289284 }
290285 }
291286
292287 group. notify ( queue: . main) { [ self ] in
293- resolve ( selections) ;
288+ resolve ( selections)
294289 DispatchQueue . main. async {
295290 alert. dismiss ( animated: true , completion: {
296291 self . dismissComplete ( )
0 commit comments