ibm-messaging / mq-golang

Calling IBM MQ from Go applications
Apache License 2.0
167 stars 60 forks source link

Fix panics in NewMQDLH #183

Closed geodimm closed 2 years ago

geodimm commented 2 years ago

Please ensure all items are complete before opening.

What

https://github.com/ibm-messaging/mq-golang/blob/fa8d9eb047f8ea5cd87d9c237e6e52d65f32d8d5/ibmmq/mqiDLH.go#L134 causes NewMQDLH to panic as it's trying to access the PutDate and PutTime fields of a nil struct.

How

Copy over the original put timestamp from the MQMD struct only if it's not null

Testing

Tests have been added to assert the expected behaviour. Without the code change, the code would panic.

Issues

Links to the github issue(s) (if present) that this pull request is resolving.

ibmmqmet commented 2 years ago

Thanks for thie one.