1
0
mirror of https://github.com/s00500/ESPUI.git synced 2024-11-22 04:00:55 +00:00

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

View File

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