Skip to content

Commit

Permalink
Check if attribute handle supports emit before calling
Browse files Browse the repository at this point in the history
Origin: noble#369
Change-Id: Icdc68c129ab7b165f5b30e15812e9d7316346146
  • Loading branch information
sandeepmistry authored and rzr committed Apr 15, 2021
1 parent bfb33fe commit e3b21df
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/hci-socket/gatt.js
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,9 @@ Gatt.prototype.handleWriteRequestOrCommand = function(request) {
handleAttribute.emit('subscribe', this._mtu - 3, updateValueCallback);
}
} else {
handleAttribute.emit('unsubscribe');
if (handleAttribute.emit) {
handleAttribute.emit('unsubscribe');
}
}

result = ATT_ECODE_SUCCESS;
Expand Down

0 comments on commit e3b21df

Please sign in to comment.