From 737b7cc4710049d91aa633b2cc27d003c95100b4 Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Sun, 16 Nov 2025 14:52:18 +0100 Subject: [PATCH] bus robustness improvement ABL and SerializeConfig explicitly check bus->isOK(), instead of relying on bus->getLength() == 0 --- wled00/FX_fcn.cpp | 1 + wled00/cfg.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/wled00/FX_fcn.cpp b/wled00/FX_fcn.cpp index b3b9cc54..879b93a2 100644 --- a/wled00/FX_fcn.cpp +++ b/wled00/FX_fcn.cpp @@ -2052,6 +2052,7 @@ void WS2812FX::estimateCurrentAndLimitBri() { for (uint_fast8_t bNum = 0; bNum < busses.getNumBusses(); bNum++) { Bus *bus = busses.getBus(bNum); + if (!bus || !bus->isOk()) continue; // WLEDMM skip busses that are not initialized yet auto btype = bus->getType(); if (EXCLUDE_FROM_ABL(btype)) continue; // WLEDMM exclude non-ABL and network busses uint16_t len = bus->getLength(); diff --git a/wled00/cfg.cpp b/wled00/cfg.cpp index 069b303a..6a6849bd 100644 --- a/wled00/cfg.cpp +++ b/wled00/cfg.cpp @@ -817,7 +817,7 @@ void serializeConfig() { for (uint8_t s = 0; s < busses.getNumBusses(); s++) { Bus *bus = busses.getBus(s); - if (!bus || bus->getLength()==0) break; + if (!bus || !bus->isOk() || bus->getLength()==0) break; // WLEDMM exclude not initialized busses JsonObject ins = hw_led_ins.createNestedObject(); ins["start"] = bus->getStart(); ins["len"] = bus->getLength();