From 627c0a31b22026809cea3c5cb3c0a81d2a632117 Mon Sep 17 00:00:00 2001 From: Miguel Ruivo Date: Wed, 3 Mar 2021 22:08:52 +0000 Subject: [PATCH] Fixes #606 --- CHANGELOG.md | 5 +++++ ios/Classes/FilePickerPlugin.m | 6 ++++-- pubspec.yaml | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 590b8b7..9cf9dc9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 2.1.7 +### iOS +- Fixes an issue where a crash could happen when picking a lot of media files in low memory devices ([#606](https://github.com/miguelpruivo/flutter_file_picker/issues/606)). +- Updates `preferredAssetRepresentationMode`. Thank you @nrikiji. + ## 2.1.6 - Addresses an issue on iOS 14 and later where events `onFileLoading` events weren't being provided ([#577](https://github.com/miguelpruivo/flutter_file_picker/issues/577)). diff --git a/ios/Classes/FilePickerPlugin.m b/ios/Classes/FilePickerPlugin.m index d5c7e16..5aea407 100644 --- a/ios/Classes/FilePickerPlugin.m +++ b/ios/Classes/FilePickerPlugin.m @@ -266,8 +266,10 @@ [dkImagePickerController setDidSelectAssets:^(NSArray * __nonnull DKAssets) { NSMutableArray* paths = [[NSMutableArray alloc] init]; - for(DKAsset * asset in DKAssets){ - [paths addObject:asset.localTemporaryPath.absoluteURL]; + for(DKAsset * asset in DKAssets) { + if(asset.localTemporaryPath.absoluteURL != nil) { + [paths addObject:asset.localTemporaryPath.absoluteURL]; + } } [self handleResult: paths]; diff --git a/pubspec.yaml b/pubspec.yaml index fe876de..b068c18 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: file_picker description: A package that allows you to use a native file explorer to pick single or multiple absolute file paths, with extension filtering support. homepage: https://github.com/miguelpruivo/plugins_flutter_file_picker -version: 2.1.6 +version: 2.1.7 dependencies: flutter: