From bc24be8584c47e5c091dd08880c3073fe10e72a4 Mon Sep 17 00:00:00 2001 From: Nick Lockwood Date: Tue, 28 Apr 2015 04:53:55 -0700 Subject: [PATCH] Fixed nil object insertion crash due to incorrectly encoded HTTP response body data --- Libraries/Network/RCTDataManager.m | 2 +- React/Base/RCTBridge.m | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Libraries/Network/RCTDataManager.m b/Libraries/Network/RCTDataManager.m index 634d325e9..63aa8f10a 100644 --- a/Libraries/Network/RCTDataManager.m +++ b/Libraries/Network/RCTDataManager.m @@ -61,7 +61,7 @@ RCT_EXPORT_METHOD(queryData:(NSString *)queryType responseJSON = @{ @"status": @0, @"responseHeaders": @{}, - @"responseText": [connectionError localizedDescription] + @"responseText": [connectionError localizedDescription] ?: [NSNull null]; }; } diff --git a/React/Base/RCTBridge.m b/React/Base/RCTBridge.m index 7dc2322f0..4a14713c7 100644 --- a/React/Base/RCTBridge.m +++ b/React/Base/RCTBridge.m @@ -191,6 +191,7 @@ static NSArray *RCTBridgeModuleClassesByModuleID(void) superclass = class_getSuperclass(superclass); } } + free(classes); } });