From 94ba5c60bea6d11b8778b6e78aaff8322bd40de5 Mon Sep 17 00:00:00 2001 From: rus084 Date: Wed, 6 Dec 2023 07:29:40 +0300 Subject: [PATCH] Check mBleEndPoint before sending messages in BLEBase (#30794) --- src/transport/raw/BLE.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/transport/raw/BLE.cpp b/src/transport/raw/BLE.cpp index 7e40857f62325c..76123afd516415 100644 --- a/src/transport/raw/BLE.cpp +++ b/src/transport/raw/BLE.cpp @@ -99,6 +99,7 @@ CHIP_ERROR BLEBase::SetEndPoint(Ble::BLEEndPoint * endPoint) CHIP_ERROR BLEBase::SendMessage(const Transport::PeerAddress & address, System::PacketBufferHandle && msgBuf) { ReturnErrorCodeIf(address.GetTransportType() != Type::kBle, CHIP_ERROR_INVALID_ARGUMENT); + ReturnErrorCodeIf(mBleEndPoint == nullptr, CHIP_ERROR_INCORRECT_STATE); ReturnErrorCodeIf(mState == State::kNotReady, CHIP_ERROR_INCORRECT_STATE); if (mState == State::kConnected)