From 16ddc8a61625bef0676442f61ec766a319e4cecd Mon Sep 17 00:00:00 2001 From: Krzysztof Strehlau Date: Wed, 19 Jun 2024 17:32:22 +0200 Subject: [PATCH] Update ksMqttConnector.cpp --- src/ksf/comp/ksMqttConnector.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/ksf/comp/ksMqttConnector.cpp b/src/ksf/comp/ksMqttConnector.cpp index 0426f3a..8faa2bd 100644 --- a/src/ksf/comp/ksMqttConnector.cpp +++ b/src/ksf/comp/ksMqttConnector.cpp @@ -85,15 +85,16 @@ namespace ksf::comps netClientUq = std::make_unique(); } - /* Set MQTT timeout. */ + /* Whoops, it looks like fingerprint validation failed. */ + if (!netClientUq) + return; + + /* Set MQTT timeouts. */ netClientUq->setTimeout(KSF_MQTT_TIMEOUT_MS); #if ESP32 netClientUq->setConnectionTimeout(KSF_MQTT_TIMEOUT_MS); #endif - /* Whoops, it looks like fingerprint validation failed. */ - if (!netClientUq) - return; - + mqttClientUq = std::make_unique(*netClientUq.get()); this->login = std::move(login);