Skip to content

Commit 87ea022

Browse files
Recover assertion that this.connection should exist at point of flashing
1 parent f686b91 commit 87ea022

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/bluetooth.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -483,10 +483,8 @@ class MicrobitWebBluetoothConnectionImpl
483483
if (this.status !== ConnectionStatus.CONNECTED) {
484484
await this.connect({ progress, signal: options.signal });
485485
}
486-
if (!this.connection) {
487-
throw new Error("Unexpected connection undefined!");
488-
}
489-
const connection = this.connection;
486+
487+
const connection = this.connection!;
490488
try {
491489
const boardVersion = connection.boardVersion;
492490
if (!boardVersion) {

0 commit comments

Comments
 (0)