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

Null for exception message results in NPE on RepublishMessageRecoverer #1166

Closed
furlaneto opened this issue Feb 19, 2020 · 0 comments · Fixed by #1167
Closed

Null for exception message results in NPE on RepublishMessageRecoverer #1166

furlaneto opened this issue Feb 19, 2020 · 0 comments · Fixed by #1167
Assignees
Milestone

Comments

@furlaneto
Copy link

In RepublishMessageRecoverer#truncateIfNecessary when the message exception is null results in NPE.

java.lang.NullPointerException: null
	at org.springframework.amqp.rabbit.retry.RepublishMessageRecoverer.truncateIfNecessary(RepublishMessageRecoverer.java:213) ~[spring-rabbit-2.2.3.RELEASE.jar:2.2.3.RELEASE]
	at org.springframework.amqp.rabbit.retry.RepublishMessageRecoverer.processStackTrace(RepublishMessageRecoverer.java:206) ~[spring-rabbit-2.2.3.RELEASE.jar:2.2.3.RELEASE]
	at org.springframework.amqp.rabbit.retry.RepublishMessageRecoverer.recover(RepublishMessageRecoverer.java:158) ~[spring-rabbit-2.2.3.RELEASE.jar:2.2.3.RELEASE]

Example of code:

RepublishMessageRecoverer recoverer = new RepublishMessageRecoverer(amqpTemplate);
Throwable nullMessageCause = new Exception(new Exception());
recoverer.recover(message, nullMessageCause);

Versions: 2.2.3 +

@garyrussell garyrussell self-assigned this Feb 19, 2020
@garyrussell garyrussell added this to the 2.2.5 milestone Feb 19, 2020
garyrussell added a commit to garyrussell/spring-amqp that referenced this issue Feb 19, 2020
Resolves spring-projects#1166

Occurred when the cause had a `null` message.
artembilan pushed a commit that referenced this issue Feb 19, 2020
Resolves #1166

Occurred when the cause had a `null` message.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants