Skip to content

Commit b04fe93

Browse files
mickeylCopilot
andauthored
Update src/NimBLEL2CAPChannel.cpp
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 27ff34b commit b04fe93

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/NimBLEL2CAPChannel.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,9 @@ bool NimBLEL2CAPChannel::disconnect() {
219219
}
220220

221221
uint16_t NimBLEL2CAPChannel::getConnHandle() const {
222+
if (!this->channel) {
223+
return BLE_HS_CONN_HANDLE_NONE;
224+
}
222225
return ble_l2cap_get_conn_handle(this->channel);
223226
}
224227

0 commit comments

Comments
 (0)