CAMEL-6723: Fixed Message history - Possible ArrayIndexOutOfBoundsException