From 5fe8be0f1b766a7d94b85778878b16af4cde5944 Mon Sep 17 00:00:00 2001 From: pennam Date: Fri, 9 Aug 2024 18:06:20 +0200 Subject: [PATCH] Fix connection without ConnectionHandler --- src/ArduinoIoTCloudTCP.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ArduinoIoTCloudTCP.cpp b/src/ArduinoIoTCloudTCP.cpp index 788520d8..cc74a324 100644 --- a/src/ArduinoIoTCloudTCP.cpp +++ b/src/ArduinoIoTCloudTCP.cpp @@ -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;