NO-JIRA Check data != null during encode
Picked up by code analysis checks
This commit is contained in:
parent
82ab6ff159
commit
07fa93dfae
|
@ -815,13 +815,13 @@ public class AMQPMessage extends RefCountMessage {
|
||||||
encoder.writeObject(applicationProperties);
|
encoder.writeObject(applicationProperties);
|
||||||
|
|
||||||
// Now raw write the remainder body and footer if present.
|
// Now raw write the remainder body and footer if present.
|
||||||
if (remainingBodyPosition != VALUE_NOT_PRESENT) {
|
if (data != null && remainingBodyPosition != VALUE_NOT_PRESENT) {
|
||||||
writable.put(data.position(remainingBodyPosition));
|
writable.put(data.position(remainingBodyPosition));
|
||||||
}
|
}
|
||||||
} else if (applicationPropertiesPosition != VALUE_NOT_PRESENT) {
|
} else if (data != null && applicationPropertiesPosition != VALUE_NOT_PRESENT) {
|
||||||
// Writes out ApplicationProperties, Body and Footer in one go if present.
|
// Writes out ApplicationProperties, Body and Footer in one go if present.
|
||||||
writable.put(data.position(applicationPropertiesPosition));
|
writable.put(data.position(applicationPropertiesPosition));
|
||||||
} else if (remainingBodyPosition != VALUE_NOT_PRESENT) {
|
} else if (data != null && remainingBodyPosition != VALUE_NOT_PRESENT) {
|
||||||
// No Application properties at all so raw write Body and Footer sections
|
// No Application properties at all so raw write Body and Footer sections
|
||||||
writable.put(data.position(remainingBodyPosition));
|
writable.put(data.position(remainingBodyPosition));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue