Fix Arduino build: use length() instead of empty()

Arduino String has isEmpty() not empty(). Use length() > 0
which works on both std::string and Arduino String.
This commit is contained in:
J. Nick Koston
2026-02-11 17:57:39 -06:00
parent ca92601b5a
commit 0a99abd63f

View File

@@ -558,7 +558,7 @@ class WebServer : public Controller,
template<typename T, typename Ret>
void parse_bool_param_(AsyncWebServerRequest *request, ParamNameType param_name, T &call, Ret (T::*setter)(bool)) {
const auto &param_value = request->arg(param_name);
if (!param_value.empty()) {
if (param_value.length() > 0) {
// First check on/off (default), then true/false (custom)
auto val = parse_on_off(param_value.c_str());
if (val == PARSE_NONE) {