From 1424b6d1a4435830b908d2d45c74b1af06831ca7 Mon Sep 17 00:00:00 2001 From: sticilface Date: Mon, 16 Apr 2018 17:56:58 +0100 Subject: [PATCH] Add guard to handle to check for _initialized (#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. --- 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 25164203..2d99808b 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;