Skip to content

Commit

Permalink
fix: prevent app crash when uploading images
Browse files Browse the repository at this point in the history
  • Loading branch information
majeed-platogo committed May 14, 2024
1 parent 7792e72 commit 82e88f5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

# unreleased
* Add try/catch block to prevent app crash when image is uploaded

# 6.2.9
* A crash issue in the iOS app has been resolved when the Cordova agent receives responses in the form of blobs or array buffers.
* The native iOS agent has been updated to version 7.4.11, which brings performance enhancements and bug fixes.
Expand Down
6 changes: 5 additions & 1 deletion src/ios/NewRelicCordovaPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,11 @@ - (void)noticeHttpTransaction:(CDVInvokedUrlCommand *)command {
data = [body dataUsingEncoding:NSUTF8StringEncoding];
}

[NewRelic noticeNetworkRequestForURL:nsurl httpMethod:method startTime:[startTime doubleValue] endTime:[endTime doubleValue] responseHeaders:nil statusCode:(long)[status integerValue] bytesSent:(long)[bytesSent integerValue] bytesReceived:(long)[bytesreceived integerValue] responseData:data traceHeaders:traceAttributes andParams:params];
@try {
[NewRelic noticeNetworkRequestForURL:nsurl httpMethod:method startTime:[startTime doubleValue] endTime:[endTime doubleValue] responseHeaders:nil statusCode:(long)[status integerValue] bytesSent:(long)[bytesSent integerValue] bytesReceived:(long)[bytesreceived integerValue] responseData:data traceHeaders:traceAttributes andParams:params];
} @catch (NSException * e) {

}
}

- (void)crashNow:(CDVInvokedUrlCommand *)command {
Expand Down

0 comments on commit 82e88f5

Please sign in to comment.