Skip to content

Commit a580ce2

Browse files
author
Sefa Ilkimen
committed
Merge branch 'patch-1' of https://github.com/troyanskiy/cordova-HTTP into troyanskiy-patch-1
2 parents 35dc020 + 2dbf0d4 commit a580ce2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/ios/CordovaHttpPlugin.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ - (void)handleError:(NSMutableDictionary*)dictionary withResponse:(NSHTTPURLResp
6969
[dictionary setValue:response.URL.absoluteString forKey:@"url"];
7070
[dictionary setObject:[NSNumber numberWithInt:(int)response.statusCode] forKey:@"status"];
7171
[dictionary setObject:[self copyHeaderFields:response.allHeaderFields] forKey:@"headers"];
72-
[dictionary setObject:error.userInfo[AFNetworkingOperationFailingURLResponseBodyKey] forKey:@"error"];
72+
if (error.userInfo[AFNetworkingOperationFailingURLResponseBodyKey]) {
73+
[dictionary setObject:error.userInfo[AFNetworkingOperationFailingURLResponseBodyKey] forKey:@"error"];
74+
}
7375
} else {
7476
[dictionary setObject:[self getStatusCode:error] forKey:@"status"];
7577
[dictionary setObject:[error localizedDescription] forKey:@"error"];

0 commit comments

Comments
 (0)