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

NPE guard in AgentAttributeSender.removeAttribute() #1762

Merged
merged 2 commits into from
Feb 26, 2024
Merged

Conversation

jtduffy
Copy link
Contributor

@jtduffy jtduffy commented Feb 26, 2024

Resolves #1749

Add an NPE check prior to calling .remove() on the return value from getAttributeMap().

This corrects the issue where NewRelicApiImplementation.setUserId() was throwing an exception when called outside of a transaction.

@jtduffy jtduffy requested a review from a team February 26, 2024 20:13
@codecov-commenter
Copy link

codecov-commenter commented Feb 26, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 70.81%. Comparing base (624ff4c) to head (b819262).

Files Patch % Lines
...ewrelic/agent/attributes/AgentAttributeSender.java 50.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1762      +/-   ##
============================================
- Coverage     70.83%   70.81%   -0.02%     
  Complexity     9931     9931              
============================================
  Files           825      825              
  Lines         39820    39823       +3     
  Branches       6034     6035       +1     
============================================
- Hits          28206    28201       -5     
- Misses         8891     8896       +5     
- Partials       2723     2726       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jtduffy jtduffy merged commit ae03a7c into main Feb 26, 2024
103 checks passed
@jtduffy jtduffy deleted the setuserid-npe-fix branch February 26, 2024 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

NullPointerException if setUserId is called with an empty argument and no transaction is active
3 participants