From 254912aee51ee9e080b00f49094ba445250a6ed6 Mon Sep 17 00:00:00 2001 From: Ian Gray Date: Thu, 13 Jan 2022 21:29:22 +0000 Subject: [PATCH] Add a null check in updateControl This means that calling any updates before the GUI is created will now not cause a crash. --- src/ESPUI.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ESPUI.cpp b/src/ESPUI.cpp index 58e5081..43b8fb7 100644 --- a/src/ESPUI.cpp +++ b/src/ESPUI.cpp @@ -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();