From 1c3a6d47065b85a1d44eba3d8dd0a54db5c37787 Mon Sep 17 00:00:00 2001 From: Pawel Andruszkiewicz Date: Tue, 12 May 2015 09:14:09 +0200 Subject: [PATCH] [BluetoothLE] Added error checks when removing a listener (JS). Change-Id: I173ae5ccba094e3cf0a98bd265873e0490942378 Signed-off-by: Pawel Andruszkiewicz --- src/bluetooth/bluetooth_api.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/bluetooth/bluetooth_api.js b/src/bluetooth/bluetooth_api.js index 472e193a..e5942683 100644 --- a/src/bluetooth/bluetooth_api.js +++ b/src/bluetooth/bluetooth_api.js @@ -1806,7 +1806,10 @@ function _multipleListenerBuilder(name, callback, addListenerId, removeListenerI } if (removeId && ((nativeListenerRegistered && T.isEmptyObject(listeners)) || repeatNativeListenerCall)) { - native.callSync(removeId, args || {}); + var result = native.callSync(removeId, args || {}); + if (native.isFailure(result)) { + throw native.getErrorObject(result); + } nativeListenerRegistered = false; } -- 2.34.1