Skip to content
Permalink
Browse files

fixed blobmanager inserting nil when there's no mime type

Summary:
Upon handling symbolication response when a redbox occurs, the blob manager inserted `nil` mime type because the response header doesn't specify any. This crashed the app with exception:

```
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[4]'
terminating with uncaught exception of type NSException
```

Reviewed By: shergin

Differential Revision: D6945632

fbshipit-source-id: 9298bd2674447106763c73e1a5035417bd30f29c
  • Loading branch information...
fkgozali authored and facebook-github-bot committed Feb 9, 2018
1 parent fa0ac92 commit 854c2330ebe748eb0508bb788685232b6cff0022
Showing with 3 additions and 2 deletions.
  1. +3 −2 Libraries/Blob/RCTBlobManager.mm
@@ -13,6 +13,7 @@

#import <React/RCTConvert.h>
#import <React/RCTNetworking.h>
#import <React/RCTUtils.h>
#import <React/RCTWebSocketModule.h>

static NSString *const kBlobURIScheme = @"blob";
@@ -263,8 +264,8 @@ - (id)handleNetworkingResponse:(NSURLResponse *)response data:(NSData *)data
@"blobId": [self store:data],
@"offset": @0,
@"size": @(data.length),
@"name": [response suggestedFilename],
@"type": [response MIMEType],
@"name": RCTNullIfNil([response suggestedFilename]),
@"type": RCTNullIfNil([response MIMEType]),
};
}

0 comments on commit 854c233

Please sign in to comment.
You can’t perform that action at this time.