Skip to content

Commit

Permalink
Added null check before closing connection
Browse files Browse the repository at this point in the history
  • Loading branch information
HarshGandhi-AWS committed Oct 11, 2023
1 parent d0e773d commit 5e3304b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions source/SharedCrtResourceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,10 @@ Aws::Crt::Io::ClientBootstrap *SharedCrtResourceManager::getClientBootstrap()
void SharedCrtResourceManager::disconnect()
{
LOG_DEBUG(TAG, "Attempting to disconnect MQTT connection");
if (connection == NULL)
{
return;
}
if (connection->Disconnect())
{
if (connectionClosedPromise.get_future().wait_for(std::chrono::seconds(DEFAULT_WAIT_TIME_SECONDS)) ==
Expand Down

0 comments on commit 5e3304b

Please sign in to comment.