Prevent setting onCharactericChanged callback to null.

This commit is contained in:
Evelyn Eastmond 2019-01-16 19:50:32 -05:00
parent 6e290ea937
commit 802f752ded

View file

@ -126,7 +126,9 @@ class BLE extends JSONRPCWebSocket {
if (optStartNotifications) { if (optStartNotifications) {
params.startNotifications = true; params.startNotifications = true;
} }
this._characteristicDidChangeCallback = onCharacteristicChanged; if (onCharacteristicChanged) {
this._characteristicDidChangeCallback = onCharacteristicChanged;
}
return this.sendRemoteRequest('read', params) return this.sendRemoteRequest('read', params)
.catch(e => { .catch(e => {
this.handleDisconnectError(e); this.handleDisconnectError(e);