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 in MessaageProperties.equals #730

Closed
dmoses48 opened this issue Mar 28, 2018 · 1 comment
Closed

NullPointerException in MessaageProperties.equals #730

dmoses48 opened this issue Mar 28, 2018 · 1 comment

Comments

@dmoses48
Copy link

org/springframework/amqp/core/MessageProperties.java equals method uses a non null-safe equals.

Example Test:

    MessageProperties mp = new MessageProperties();
    MessageProperties mp2 = new MessageProperties();
    mp.equals(mp2);  //Throws null pointer exception
@artembilan
Copy link
Member

Confirmed. This happens on the path:

if (!this.correlationId.equals(other.correlationId)) {
	return false;
}

We have to protect there like:

if (this.correlationId == null) {
	if (other.correlationId != null) {
		return false;
	}
}

artembilan added a commit to artembilan/spring-amqp that referenced this issue Mar 28, 2018
garyrussell pushed a commit that referenced this issue Mar 28, 2018
Fixes #730

**Cherry-pick to 2.0.x and 1.7.x**
garyrussell pushed a commit that referenced this issue Mar 28, 2018
Fixes #730

**Cherry-pick to 2.0.x and 1.7.x**
garyrussell added a commit that referenced this issue Mar 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants