diff --git a/src/helpers/socket.js b/src/helpers/socket.js index 35b30270..9c35ecba 100644 --- a/src/helpers/socket.js +++ b/src/helpers/socket.js @@ -74,7 +74,9 @@ export const createDeviceSocket = (transport: Transport<*>, url: string) => for (const apdu of data) { const r: Buffer = await transport.exchange(Buffer.from(apdu, 'hex')) lastStatus = r.slice(r.length - 2) + if (lastStatus.toString('hex') !== '9000') break } + if (!lastStatus) { throw new DeviceSocketNoBulkStatus() }