mirror of
https://github.com/s00500/ESPUI.git
synced 2024-11-21 17:40:54 +00:00
Resolve null pointer exception
Adding a separator using `ESPUI.separator("Separator name");` triggers an exception when the code tries to access the property of an invalid object.
This commit is contained in:
parent
66340823db
commit
8ca8241547
@ -531,7 +531,14 @@ uint16_t ESPUIClass::addControl(
|
||||
|
||||
NotifyClients(ClientUpdateType_t::RebuildNeeded);
|
||||
|
||||
if (control == nullptr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return control->id;
|
||||
}
|
||||
}
|
||||
|
||||
bool ESPUIClass::removeControl(uint16_t id, bool force_rebuild_ui)
|
||||
|
Loading…
Reference in New Issue
Block a user