Skip to content

Commit

Permalink
Fix crash when using BugsnagNetworkRequestPlugin alongside New Relic
Browse files Browse the repository at this point in the history
  • Loading branch information
nickdowell committed Mar 25, 2022
1 parent 09b2fed commit af57df8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
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:(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

0 comments on commit af57df8

Please sign in to comment.