Avoid NPE when setting null address

This commit is contained in:
Justin Bertram 2018-02-02 16:05:20 -06:00 committed by Michael Pearce
parent 9c40a514f2
commit f09ee40b53
1 changed files with 5 additions and 1 deletions

View File

@ -437,7 +437,11 @@ public class CoreMessage extends RefCountMessage implements ICoreMessage {
@Override
public CoreMessage setAddress(SimpleString address) {
if (validBuffer && !address.equals(this.address)) {
if (address == null && this.address == null) {
// no-op so just return
return this;
}
if (validBuffer && (address == null || !address.equals(this.address))) {
messageChanged();
}
this.address = address;