1
0
mirror of https://github.com/s00500/ESPUI.git synced 2024-11-16 19:10:54 +00:00

Remove unneeded arguments from separator function

Implement an alternate strategy for avoiding the null pointer exception. This takes the same approach as the function to add a label.
This commit is contained in:
joyfullservice 2024-09-27 09:29:03 -05:00
parent 8ca8241547
commit 8c729ee0da

View File

@ -531,14 +531,7 @@ uint16_t ESPUIClass::addControl(
NotifyClients(ClientUpdateType_t::RebuildNeeded); NotifyClients(ClientUpdateType_t::RebuildNeeded);
if (control == nullptr)
{
return 0;
}
else
{
return control->id; return control->id;
}
} }
bool ESPUIClass::removeControl(uint16_t id, bool force_rebuild_ui) bool ESPUIClass::removeControl(uint16_t id, bool force_rebuild_ui)
@ -667,7 +660,7 @@ uint16_t ESPUIClass::gauge(const char* label, ControlColor color, int number, in
uint16_t ESPUIClass::separator(const char* label) uint16_t ESPUIClass::separator(const char* label)
{ {
return addControl(ControlType::Separator, label, "", ControlColor::Alizarin, Control::noParent, nullptr); return addControl(ControlType::Separator, label, "", ControlColor::Alizarin);
} }
uint16_t ESPUIClass::fileDisplay(const char* label, ControlColor color, String filename) uint16_t ESPUIClass::fileDisplay(const char* label, ControlColor color, String filename)