diff --git a/src/messaging/ExchangeMgr.cpp b/src/messaging/ExchangeMgr.cpp index a6cfb9d1947c2e..9bad95305e21cf 100644 --- a/src/messaging/ExchangeMgr.cpp +++ b/src/messaging/ExchangeMgr.cpp @@ -94,6 +94,8 @@ CHIP_ERROR ExchangeManager::Init(SessionManager * sessionManager) CHIP_ERROR ExchangeManager::Shutdown() { + VerifyOrReturnError(mState == State::kState_Initialized, CHIP_ERROR_INCORRECT_STATE); + mReliableMessageMgr.Shutdown(); if (mSessionManager != nullptr)