Prevent config corruption by checking whether memory allocation was successfull.

This commit is contained in:
Thomas Basler
2024-01-04 13:42:39 +01:00
parent c1fc907ecb
commit 4053e31a5e
14 changed files with 46 additions and 43 deletions

View File

@@ -175,11 +175,7 @@ void WebApiDeviceClass::onDeviceAdminPost(AsyncWebServerRequest* request)
Display.setLanguage(config.Display.Language);
Display.Diagram().updatePeriod();
Configuration.write();
retMsg["type"] = "success";
retMsg["message"] = "Settings saved!";
retMsg["code"] = WebApiError::GenericSuccess;
WebApi.writeConfig(retMsg);
response->setLength();
request->send(response);