Skip to content

Commit

Permalink
GH-730: Fix NPE in the MessageProperties
Browse files Browse the repository at this point in the history
Fixes #730
  • Loading branch information
garyrussell committed Mar 28, 2018
1 parent c8d66d2 commit d6a5a75
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,14 @@ else if (!this.contentType.equals(other.contentType)) {
if (!Arrays.equals(this.correlationId, other.correlationId)) {
return false;
}
if (this.correlationIdString == null) {
if (other.correlationIdString != null) {
return false;
}
}
else if (!this.correlationIdString.equals(other.correlationIdString)) {
return false;
}
if (this.deliveryMode != other.deliveryMode) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package org.springframework.amqp.core;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import org.junit.Test;

Expand All @@ -41,4 +42,11 @@ public void testReplyToNullByDefault() throws Exception {
assertEquals(null, properties.getReplyToAddress());
}

@Test
public void tesNoNullPointerInEquals() {
MessageProperties mp = new MessageProperties();
MessageProperties mp2 = new MessageProperties();
assertTrue(mp.equals(mp2));
}

}

0 comments on commit d6a5a75

Please sign in to comment.