Skip to content

Commit ba32d1c

Browse files
author
Marco Crespi
committed
fix(win): Fix notify subscription bug
1 parent 4c6ca74 commit ba32d1c

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

lib/bindings/win/gatt/Characteristic.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/bindings/win/gatt/Characteristic.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/bindings/win/gatt/Characteristic.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export class WinGattCharacteristic extends GattCharacteristic {
6464
const handler = (dev: string, srv: string, char: string, err: Error) => {
6565
if (dev === this.service.gatt.peripheral.uuid && srv === this.service.uuid && char === this.uuid) {
6666
noble.off('write', handler);
67-
if (err) {
67+
if (err instanceof Error) {
6868
reject(err);
6969
} else {
7070
resolve();
@@ -88,7 +88,7 @@ export class WinGattCharacteristic extends GattCharacteristic {
8888
const handler = (dev: string, srv: string, char: string, err: Error) => {
8989
if (dev === this.service.gatt.peripheral.uuid && srv === this.service.uuid && char === this.uuid) {
9090
noble.off('notify', handler);
91-
if (err) {
91+
if (err instanceof Error) {
9292
reject(err);
9393
} else {
9494
resolve();

0 commit comments

Comments
 (0)