[Bluetooth] Fix the invalid array index issue (#666)