Add NOLINT for length() > 0 cross-platform check

Arduino String has isEmpty() not empty(). Using length() > 0
works on both std::string and Arduino String.
This commit is contained in:
J. Nick Koston
2026-02-11 18:03:32 -06:00
parent c6b51d3434
commit c2bb55ff5d

View File

@@ -557,7 +557,8 @@ 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.length() > 0) {
// Arduino String has isEmpty() not empty(), use length() for cross-platform compatibility
if (param_value.length() > 0) { // NOLINT(readability-container-size-empty)
// First check on/off (default), then true/false (custom)
auto val = parse_on_off(param_value.c_str());
if (val == PARSE_NONE) {