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:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user