File tree Expand file tree Collapse file tree 3 files changed +14
-5
lines changed
Expand file tree Collapse file tree 3 files changed +14
-5
lines changed Original file line number Diff line number Diff line change 1+ ## 4.6.1
2+
3+ #### iOS
4+ Handle ` UTTypeCreatePreferredIdentifierForTag ` returning ` NULL ` . This prevents a crash observed
5+ on the iOS simulator on Apple Silicon ([ #1040 ] ( https://github.com/miguelpruivo/flutter_file_picker/issues/783 ) ).
6+
17## 4.6.0
28
39#### iOS
Original file line number Diff line number Diff line change @@ -47,15 +47,18 @@ + (BOOL) clearTemporaryFiles {
4747
4848 NSMutableArray <NSString *>* utis = [[NSMutableArray <NSString *> alloc] init ];
4949
50- for (int i = 0 ; i<allowedExtensions.count ; i++){
50+ for (int i = 0 ; i<allowedExtensions.count ; i++) {
5151 NSString * format = [NSString stringWithFormat: @" dummy.%@ " , allowedExtensions[i]];
5252 CFStringRef UTI = UTTypeCreatePreferredIdentifierForTag (kUTTagClassFilenameExtension , (__bridge CFStringRef)[format pathExtension ], NULL );
5353 NSString * UTIString = (__bridge NSString *)(UTI);
54- CFRelease (UTI);
55- if ([UTIString containsString: @" dyn." ]){
54+ if (UTI) CFRelease (UTI);
55+ if (!UTI) {
56+ Log (@" [Skipping type] Resolving type from extension is not supported: %@ " , allowedExtensions[i]);
57+ continue ;
58+ } else if ([UTIString containsString: @" dyn." ]) {
5659 Log (@" [Skipping type] Unsupported file type: %@ " , UTIString);
5760 continue ;
58- } else {
61+ } else {
5962 Log (@" Custom file type supported: %@ " , UTIString);
6063 [utis addObject: UTIString];
6164 }
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ description: A package that allows you to use a native file explorer to pick sin
33homepage : https://github.com/miguelpruivo/plugins_flutter_file_picker
44repository : https://github.com/miguelpruivo/flutter_file_picker
55issue_tracker : https://github.com/miguelpruivo/flutter_file_picker/issues
6- version : 4.6.0
6+ version : 4.6.1
77
88dependencies :
99 flutter :
You can’t perform that action at this time.
0 commit comments