From 802f752ded4a343224ce51022768488ff79b79f4 Mon Sep 17 00:00:00 2001 From: Evelyn Eastmond Date: Wed, 16 Jan 2019 19:50:32 -0500 Subject: [PATCH] Prevent setting onCharactericChanged callback to null. --- src/io/ble.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/io/ble.js b/src/io/ble.js index 74fded844..e2ead7454 100644 --- a/src/io/ble.js +++ b/src/io/ble.js @@ -126,7 +126,9 @@ class BLE extends JSONRPCWebSocket { if (optStartNotifications) { params.startNotifications = true; } - this._characteristicDidChangeCallback = onCharacteristicChanged; + if (onCharacteristicChanged) { + this._characteristicDidChangeCallback = onCharacteristicChanged; + } return this.sendRemoteRequest('read', params) .catch(e => { this.handleDisconnectError(e);