Add a null check in updateControl

This means that calling any updates before the GUI is created will
now not cause a crash.
This commit is contained in:
Ian Gray 2022-01-13 21:29:22 +00:00
parent 3b8f71a0f5
commit 254912aee5
1 changed files with 5 additions and 0 deletions

View File

@ -763,6 +763,11 @@ void ESPUIClass::updateControl(Control* control, int clientId)
return;
}
if (this->ws == nullptr)
{
return;
}
String json;
DynamicJsonDocument document(jsonUpdateDocumentSize);
JsonObject root = document.to<JsonObject>();