From 267a524ea24909e37703297e7999f63538e2c9e8 Mon Sep 17 00:00:00 2001 From: WanqQixiang Date: Fri, 27 Dec 2024 11:45:56 +0800 Subject: [PATCH] ESP32: report network status change only when the data model provider is set --- src/platform/ESP32/NetworkCommissioningDriver.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/platform/ESP32/NetworkCommissioningDriver.cpp b/src/platform/ESP32/NetworkCommissioningDriver.cpp index 1ded189218ce82..25f28cabe98c50 100644 --- a/src/platform/ESP32/NetworkCommissioningDriver.cpp +++ b/src/platform/ESP32/NetworkCommissioningDriver.cpp @@ -15,6 +15,7 @@ * limitations under the License. */ +#include #include #include #include @@ -458,6 +459,7 @@ void ESPWiFiDriver::OnScanWiFiNetworkDone() void ESPWiFiDriver::OnNetworkStatusChange() { + VerifyOrReturn(app::InteractionModelEngine::GetInstance() && app::InteractionModelEngine::GetInstance()->GetDataModelProvider()); Network configuredNetwork; bool staEnabled = false, staConnected = false; VerifyOrReturn(ESP32Utils::IsStationEnabled(staEnabled) == CHIP_NO_ERROR);