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) {
202202 msg .SetJMSCorrelationID (testCorrel )
203203 assert .Equal (t , testCorrel , msg .GetJMSCorrelationID ())
204204
205+ // Empty correlationID
206+ testCorrel = "000000000000000000000000000000000000000000000000"
207+ msg .SetJMSCorrelationID (testCorrel )
208+ assert .Equal (t , "" , msg .GetJMSCorrelationID ())
209+
205210}
Original file line number Diff line number Diff line change @@ -175,10 +175,8 @@ func (msg *MessageImpl) GetJMSCorrelationID() string {
175175 // Here we identify any padding zero bytes to trim off so that we can try
176176 // to turn it back into a string.
177177 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 --
182180 }
183181
184182 // Attempt to decode the content back into a string.
You can’t perform that action at this time.
0 commit comments