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

NullPointerException if setUserId is called with an empty argument and no transaction is active #1749

Closed
petenattress opened this issue Feb 19, 2024 · 1 comment · Fixed by #1762
Assignees
Labels
1 Story Point Estimate bug Something isn't working as designed/intended jan-mar qtr Represents proposed work item for the Jan-Mar quarter

Comments

@petenattress
Copy link

Description

We occasionally encounter an exception from calls to NewRelic.setUserId(). This appears to be caused by this line in AgentAttributeSender, which returns a null map reference when no transaction is active.

java.lang.NullPointerException: Cannot invoke "java.util.Map.remove(Object)" because the return value of "com.newrelic.agent.attributes.AgentAttributeSender.getAttributeMap()" is null
    at com.newrelic.agent.attributes.AgentAttributeSender.removeAttribute(AgentAttributeSender.java:37)
    at com.newrelic.api.agent.NewRelicApiImplementation.setUserId(NewRelicApiImplementation.java:270)
    at com.newrelic.api.agent.NewRelic.setUserId(NewRelic.java:229)

Expected Behavior

Calls to setUserId() should succeed regardless of value of user ID argument or transaction state.

Your Environment

  • NewRelic Java agent v8.9.1
  • JDK Eclipse Temurin 21.0.2
@petenattress petenattress added the bug Something isn't working as designed/intended label Feb 19, 2024
@workato-integration
Copy link

@kford-newrelic kford-newrelic added the jan-mar qtr Represents proposed work item for the Jan-Mar quarter label Feb 20, 2024
@kford-newrelic kford-newrelic moved this from Triage to In Quarter in Java Engineering Board Feb 20, 2024
@kford-newrelic kford-newrelic added the estimate Issue needing estimation label Feb 20, 2024
@kford-newrelic kford-newrelic moved this from In Quarter to In Sprint in Java Engineering Board Feb 20, 2024
@kford-newrelic kford-newrelic added 1 Story Point Estimate and removed estimate Issue needing estimation labels Feb 21, 2024
@jtduffy jtduffy moved this from In Sprint to Needs Review in Java Engineering Board Feb 26, 2024
@github-project-automation github-project-automation bot moved this from Needs Review to Code Complete/Done in Java Engineering Board Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 Story Point Estimate bug Something isn't working as designed/intended jan-mar qtr Represents proposed work item for the Jan-Mar quarter
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants