Skip to content
This repository was archived by the owner on Mar 16, 2019. It is now read-only.
This repository was archived by the owner on Mar 16, 2019. It is now read-only.

Crash in [RNFetchBlobFS readFile] on iOS #266

Closed
@cosmith

Description

@cosmith

Hi, I'm getting a crash when trying to send a file that doesn't exist anymore.

RNFetchBlob version 0.10.3, RN version 0.38.0

This is the stack trace I get:

#3  0x000000010ffd5fb4 in +[RNFetchBlobFS readFile:encoding:resolver:rejecter:onComplete:] at [APP]/node_modules/react-native-fetch-blob/ios/RNFetchBlobFS.m:426
#4  0x000000010ffe49f0 in __59+[RNFetchBlobReqBuilder buildFormBody:boundary:onComplete:]_block_invoke at [APP]/node_modules/react-native-fetch-blob/ios/RNFetchBlobReqBuilder.m:205
#5  0x000000010ffe3e42 in +[RNFetchBlobReqBuilder buildFormBody:boundary:onComplete:] at [APP]/node_modules/react-native-fetch-blob/ios/RNFetchBlobReqBuilder.m:251
#6  0x000000010ffe1843 in __89+[RNFetchBlobReqBuilder buildMultipartRequest:taskId:method:url:headers:form:onComplete:]_block_invoke at [APP]/node_modules/react-native-fetch-blob/ios/RNFetchBlobReqBuilder.m:54

It seems like the readFile method is called here and here with the resolver and rejecter set to nil.

The crash happens here:

reject(@"RNFetchBlobFS readFile error", @"file not exists", nil);

                if(![[NSFileManager defaultManager] fileExistsAtPath:path]) {
                    reject(@"RNFetchBlobFS readFile error", @"file not exists", nil);
                    return;
                }

I don't know why the try/catch block in readFile doesn't catch the exception. I tried adding a if (reject != nil) condition before the call, which works, but then the call just fails silently...

Any thoughts?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions