From f5d47fddd75828d6b391d150ea3336b65de33b78 Mon Sep 17 00:00:00 2001 From: sticilface Date: Mon, 16 Apr 2018 12:14:29 +0100 Subject: [PATCH] Add guard to handle to check for _initialized The wifi stack initialisation must be complete before calling `_udp_ota.parsePacket()` otherwise you just get a screen filled with ``` ``` and due to the more async methods in ESP32 `handle()` may be called before this can occur. --- libraries/ArduinoOTA/src/ArduinoOTA.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libraries/ArduinoOTA/src/ArduinoOTA.cpp b/libraries/ArduinoOTA/src/ArduinoOTA.cpp index 251642031db..2d99808bff5 100644 --- a/libraries/ArduinoOTA/src/ArduinoOTA.cpp +++ b/libraries/ArduinoOTA/src/ArduinoOTA.cpp @@ -370,6 +370,9 @@ void ArduinoOTAClass::end() { } void ArduinoOTAClass::handle() { + if (!_initialized) { + return; + } if (_state == OTA_RUNUPDATE) { _runUpdate(); _state = OTA_IDLE;