Fixed crash due to inserting a nil object into an array
Summary: Fixed a crash where making a network request with unrecognized/unsupported scheme would crash by attempting to insert a nil RCTNetworkTask into an array. Reviewed By: javache Differential Revision: D3275810 fb-gh-sync-id: be208c6bf87d882209901b850dcc25da4ba79a08 fbshipit-source-id: be208c6bf87d882209901b850dcc25da4ba79a08
This commit is contained in:
parent
191d278fda
commit
ed1ee9bc0f
|
@ -425,10 +425,12 @@ static UIImage *RCTResizeImageIfNeeded(UIImage *image,
|
|||
if (!_pendingTasks) {
|
||||
_pendingTasks = [NSMutableArray new];
|
||||
}
|
||||
[_pendingTasks addObject:task];
|
||||
if (MAX(_activeTasks, _scheduledDecodes) < _maxConcurrentLoadingTasks) {
|
||||
[task start];
|
||||
_activeTasks++;
|
||||
if (task) {
|
||||
[_pendingTasks addObject:task];
|
||||
if (MAX(_activeTasks, _scheduledDecodes) < _maxConcurrentLoadingTasks) {
|
||||
[task start];
|
||||
_activeTasks++;
|
||||
}
|
||||
}
|
||||
|
||||
cancelLoad = ^{
|
||||
|
|
Loading…
Reference in New Issue