File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -202,4 +202,9 @@ func TestCorrelIDParsing(t *testing.T) {
202
202
msg .SetJMSCorrelationID (testCorrel )
203
203
assert .Equal (t , testCorrel , msg .GetJMSCorrelationID ())
204
204
205
+ // Empty correlationID
206
+ testCorrel = "000000000000000000000000000000000000000000000000"
207
+ msg .SetJMSCorrelationID (testCorrel )
208
+ assert .Equal (t , "" , msg .GetJMSCorrelationID ())
209
+
205
210
}
Original file line number Diff line number Diff line change @@ -175,10 +175,8 @@ func (msg *MessageImpl) GetJMSCorrelationID() string {
175
175
// Here we identify any padding zero bytes to trim off so that we can try
176
176
// to turn it back into a string.
177
177
realLength := len (correlIDBytes )
178
- if realLength > 0 {
179
- for correlIDBytes [realLength - 1 ] == 0 {
180
- realLength --
181
- }
178
+ for realLength > 0 && correlIDBytes [realLength - 1 ] == 0 {
179
+ realLength --
182
180
}
183
181
184
182
// Attempt to decode the content back into a string.
You can’t perform that action at this time.
0 commit comments