Skip to content

Commit

Permalink
Check mBleEndPoint before sending messages in BLEBase (#30794)
Browse files Browse the repository at this point in the history
  • Loading branch information
rus084 authored Dec 6, 2023
1 parent 26b0bbf commit 94ba5c6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/transport/raw/BLE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 94ba5c6

Please sign in to comment.