From: Pawel Andruszkiewicz Date: Tue, 12 May 2015 07:14:09 +0000 (+0200) Subject: [BluetoothLE] Added error checks when removing a listener (JS). X-Git-Tag: submit/tizen_mobile/20150603.064609~1^2~31 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1c3a6d47065b85a1d44eba3d8dd0a54db5c37787;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [BluetoothLE] Added error checks when removing a listener (JS). Change-Id: I173ae5ccba094e3cf0a98bd265873e0490942378 Signed-off-by: Pawel Andruszkiewicz --- diff --git a/src/bluetooth/bluetooth_api.js b/src/bluetooth/bluetooth_api.js index 472e193..e594268 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; }