diff --git a/src/platform/ESP32/NetworkCommissioningDriver.cpp b/src/platform/ESP32/NetworkCommissioningDriver.cpp index 1ded189218ce82..77394d17f4e49a 100644 --- a/src/platform/ESP32/NetworkCommissioningDriver.cpp +++ b/src/platform/ESP32/NetworkCommissioningDriver.cpp @@ -15,6 +15,7 @@ * limitations under the License. */ +#include // nogncheck #include #include #include @@ -458,6 +459,9 @@ void ESPWiFiDriver::OnScanWiFiNetworkDone() void ESPWiFiDriver::OnNetworkStatusChange() { + // This function reports the status to the data model provider, so skip it if the provider is not ready. + VerifyOrReturn(app::InteractionModelEngine::GetInstance() && + app::InteractionModelEngine::GetInstance()->GetDataModelProvider()); Network configuredNetwork; bool staEnabled = false, staConnected = false; VerifyOrReturn(ESP32Utils::IsStationEnabled(staEnabled) == CHIP_NO_ERROR);