Fix crash caused by incorrect capture by reference in lambda def

This commit is contained in:
Jaakko Haakana 2025-07-23 00:39:48 +03:00
parent 3612e18452
commit 3d3ca6018d

View file

@ -534,7 +534,7 @@ void init_webserver() {
auto update_string = [](const char* route, std::function<void(String)> setter,
std::function<bool(String)> validator = nullptr) {
def_route_with_auth(route, server, HTTP_GET, [&](AsyncWebServerRequest* request) {
def_route_with_auth(route, server, HTTP_GET, [=](AsyncWebServerRequest* request) {
if (request->hasParam("value")) {
String value = request->getParam("value")->value();