Skip to content

Commit 1424b6d

Browse files
sticilfaceme-no-dev
authored andcommitted
Add guard to handle to check for _initialized (espressif#1321)
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.
1 parent c92b617 commit 1424b6d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

libraries/ArduinoOTA/src/ArduinoOTA.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,9 @@ void ArduinoOTAClass::end() {
370370
}
371371

372372
void ArduinoOTAClass::handle() {
373+
if (!_initialized) {
374+
return;
375+
}
373376
if (_state == OTA_RUNUPDATE) {
374377
_runUpdate();
375378
_state = OTA_IDLE;

0 commit comments

Comments
 (0)