From: Arkadiusz Pietraszek Date: Fri, 11 Sep 2020 17:18:59 +0000 (+0200) Subject: [Bluetooth] Representation of binary data unification - exceptions fix X-Git-Tag: submit/tizen/20200918.124009~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0b34bc408837237eb99236d5da4d234752c2ad85;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [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 --- diff --git a/src/bluetooth/bluetooth_api.js b/src/bluetooth/bluetooth_api.js index 0564ba6c..f6f4061d 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 {