Skip to content

Commit 5739a54

Browse files
committed
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.
1 parent e1c7e81 commit 5739a54

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

wled00/presets.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,8 @@ void savePreset(byte index, const char* pname, JsonObject sObj)
340340
presetToSave = 0;
341341
if (index > 250 || !fileDoc) {
342342
esp32SemGive(presetFileMux); // Release file mutex
343+
presetToSave = oldpresetToSave; // bugfix: restore previous state on error exit
344+
playlistSave = oldplaylistSave;
343345
return; // cannot save API calls to temporary preset (255)
344346
}
345347
sObj.remove("o");

0 commit comments

Comments
 (0)