Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PLAT-8219] Fix crash when using BugsnagNetworkRequestPlugin alongside New Relic #1324

Merged
merged 1 commit into from
Mar 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,8 @@ - (BOOL)respondsToSelector:(SEL)aSelector {
return [self.delegate respondsToSelector:aSelector];
}

- (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector {
// Note: We allow a race condition on self.tracingDelegate.canTrace because the
// caller has already determined that we respond to selector, and it would
// break things to stop "supporting" it now. We'll catch this edge case in
// forwardInvocation, and again in the call to tracingDelegate.
if (sel_isEqual(aSelector, METRICS_SELECTOR)) {
return [(NSObject *)self.tracingDelegate methodSignatureForSelector:aSelector];
}
return [(NSObject *)self.delegate methodSignatureForSelector:aSelector];
}

- (void)forwardInvocation:(NSInvocation *)invocation {
[invocation invokeWithTarget:self.delegate];
- (id)forwardingTargetForSelector:(__unused SEL)aSelector {
return self.delegate;
}

- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didFinishCollectingMetrics:(NSURLSessionTaskMetrics *)metrics
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Changelog
=========

## TBD

### Bug fixes

* Fix `-[NSProxy doesNotRecognizeSelector:]` crash when using `BugsnagNetworkRequestPlugin` in projects that use the New Relic SDK.
[#1324](https://github.com/bugsnag/bugsnag-cocoa/pull/1324)

## 6.16.4 (2022-03-02)

### Bug fixes
Expand Down