From 5739a542875adbc4d3c765bae033ca7ef7206abb Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Mon, 29 Dec 2025 21:35:10 +0100 Subject: [PATCH] savePreset() error case bugfix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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. --- wled00/presets.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wled00/presets.cpp b/wled00/presets.cpp index a728cdce..0fbaf57f 100644 --- a/wled00/presets.cpp +++ b/wled00/presets.cpp @@ -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");