examples/bluetooth: Fix check for _conn_handle being None.

Fixes issue #10755.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George 2023-02-15 14:14:49 +11:00
parent 41ed01f139
commit e1f211c6b5
2 changed files with 2 additions and 2 deletions

View File

@ -179,7 +179,7 @@ class BLESimpleCentral:
# Disconnect from current device.
def disconnect(self):
if not self._conn_handle:
if self._conn_handle is None:
return
self._ble.gap_disconnect(self._conn_handle)
self._reset()

View File

@ -196,7 +196,7 @@ class BLETemperatureCentral:
# Disconnect from current device.
def disconnect(self):
if not self._conn_handle:
if self._conn_handle is None:
return
self._ble.gap_disconnect(self._conn_handle)
self._reset()