From 0b34bc408837237eb99236d5da4d234752c2ad85 Mon Sep 17 00:00:00 2001 From: Arkadiusz Pietraszek Date: Fri, 11 Sep 2020 19:18:59 +0200 Subject: [PATCH] [Bluetooth] Representation of binary data unification - exceptions fix Fixed misarg case. Before TypeError was thrown. Corrected to TypeMismachError. [Verification] Errors tested in developer console. [ACR] TWDAPI-259 Change-Id: Ifdfc9682ed31f2cbb9f16d0d63cb2056412a9236 Signed-off-by: Arkadiusz Pietraszek --- src/bluetooth/bluetooth_api.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bluetooth/bluetooth_api.js b/src/bluetooth/bluetooth_api.js index 0564ba6..f6f4061 100755 --- a/src/bluetooth/bluetooth_api.js +++ b/src/bluetooth/bluetooth_api.js @@ -3617,7 +3617,7 @@ BluetoothManager.prototype.toByteArray = function(data) { }; var BluetoothManager_toDOMString = function(data) { - if (String === data.constructor) { + if (data && String === data.constructor) { data = BluetoothManager_checkAndNormalizeHexString(data); if (0 !== data.length) { data = '0x' + data; @@ -3634,7 +3634,7 @@ BluetoothManager.prototype.toDOMString = function(data) { }; var BluetoothManager_toUint8Array = function(data) { - if (String === data.constructor) { + if (data && String === data.constructor) { return BluetoothManager_HexStringToUint8Array(data); } else { try { -- 2.7.4