From 837b3012775b74c8d30f82783771b5c1a064e5b9 Mon Sep 17 00:00:00 2001 From: jiyuzhuang Date: Mon, 6 Jan 2025 18:01:18 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20(dmk):=20Add=20type=20chec?= =?UTF-8?q?k?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web-ble/src/api/transport/BleDeviceConnection.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/transport/web-ble/src/api/transport/BleDeviceConnection.ts b/packages/transport/web-ble/src/api/transport/BleDeviceConnection.ts index fb6c920c7..2c9ab43ca 100644 --- a/packages/transport/web-ble/src/api/transport/BleDeviceConnection.ts +++ b/packages/transport/web-ble/src/api/transport/BleDeviceConnection.ts @@ -123,10 +123,12 @@ export class BleDeviceConnection implements DeviceConnection { value: { buffer }, }, } = event; - if (!this._isDeviceReady) { - this.onReceiveSetupApduResponse(buffer); - } else { - this.receiveApdu(buffer); + if (buffer instanceof ArrayBuffer) { + if (!this._isDeviceReady) { + this.onReceiveSetupApduResponse(buffer); + } else { + this.receiveApdu(buffer); + } } };