Skip to content

Commit

Permalink
Fix connection without ConnectionHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
pennam committed Aug 9, 2024
1 parent 446720a commit 5fe8be0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ArduinoIoTCloudTCP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ int ArduinoIoTCloudTCP::begin(bool const enable_watchdog, String brokerAddress,

ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_ConnectPhy()
{
if (_connection->check() == NetworkConnectionState::CONNECTED)
if ((_connection == nullptr) || (_connection->check() == NetworkConnectionState::CONNECTED))
{
if (!_connection_attempt.isRetry() || (_connection_attempt.isRetry() && _connection_attempt.isExpired()))
return State::SyncTime;
Expand Down

0 comments on commit 5fe8be0

Please sign in to comment.