savePreset() error case bugfix

* Keeps the status machine coherent: no spurious async save, no lost pending playlist write, no change to successful paths.
* Aligns behavior with the already corrected mutex‑failure path, making both early exits consistent.
This commit is contained in:
Frank
2025-12-29 21:35:10 +01:00
parent e1c7e816fe
commit 5739a54287

View File

@@ -340,6 +340,8 @@ void savePreset(byte index, const char* pname, JsonObject sObj)
presetToSave = 0;
if (index > 250 || !fileDoc) {
esp32SemGive(presetFileMux); // Release file mutex
presetToSave = oldpresetToSave; // bugfix: restore previous state on error exit
playlistSave = oldplaylistSave;
return; // cannot save API calls to temporary preset (255)
}
sObj.remove("o");