From dfb8de23496d136902852c6b655d55e170bed43b Mon Sep 17 00:00:00 2001 From: Blaz Kristan Date: Tue, 6 Jun 2023 20:56:33 +0200 Subject: [PATCH] Fix for #3204 --- wled00/presets.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wled00/presets.cpp b/wled00/presets.cpp index 7c1ce6cc..574d5335 100644 --- a/wled00/presets.cpp +++ b/wled00/presets.cpp @@ -167,7 +167,8 @@ void handlePresets() changePreset = true; } else { if (!fdo["seg"].isNull() || !fdo["on"].isNull() || !fdo["bri"].isNull() || !fdo["nl"].isNull() || !fdo["ps"].isNull() || !fdo[F("playlist")].isNull()) changePreset = true; - fdo.remove("ps"); //remove load request for presets to prevent recursive crash + if (!(tmpMode == CALL_MODE_BUTTON_PRESET && fdo["ps"].is() && strchr(fdo["ps"].as(),'~') != strrchr(fdo["ps"].as(),'~'))) + fdo.remove("ps"); // remove load request for presets to prevent recursive crash (if not called by button and contains preset cycling string "1~5~") deserializeState(fdo, CALL_MODE_NO_NOTIFY, tmpPreset); // may change presetToApply by calling applyPreset() } if (!errorFlag && tmpPreset < 255 && changePreset) presetCycCurr = currentPreset = tmpPreset;