Skip to content

Fixed crash in case if allowedFileTypes is not empty#30

Open
undersun81 wants to merge 2 commits intodanielbierwirth:masterfrom
undersun81:master
Open

Fixed crash in case if allowedFileTypes is not empty#30
undersun81 wants to merge 2 commits intodanielbierwirth:masterfrom
undersun81:master

Conversation

@undersun81
Copy link
Copy Markdown

for (NSString *file in files) {
'file' Expected type NSString but actual NSDictionary which leads to crash

if (self.allowedFileTypes.count == 0 || [self.allowedFileTypes containsObject:[file pathExtension]]) {
for (NSDictionary *file in files) {
BOOL isFolder = [file[ODBFileKeys.kDropboxFileType] isEqualToString: ODBFileKeys.kDropboxFileTypeFolder];
NSString* fileExtension = [file[ODBFileKeys.kDropboxFileName] pathExtension];
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think only

                for (NSDictionary *file in files) {
                    if (self.allowedFileTypes.count == 0 || [self.allowedFileTypes containsObject:[file valueForKey:@"type"]]) {
                        [self.currentFiles addObject:file];
                    }
                }

would work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants