diff --git a/lib/uart.js b/lib/uart.js index a142c18..0912bc1 100644 --- a/lib/uart.js +++ b/lib/uart.js @@ -235,7 +235,7 @@ class BluetoothHciSocket extends EventEmitter { write (data) { debug(`Write: ${data.toString('hex')}`); - if (this._mode === 'raw' || this._mode === 'user') { + if ((this._mode === 'raw' || this._mode === 'user') && this._queue) { this._queue.push(data); } }