From 469492a41a249ec76dfde9a8722dd93f3e7f182a Mon Sep 17 00:00:00 2001 From: s-hadinger <49731213+s-hadinger@users.noreply.github.com> Date: Thu, 25 Apr 2024 09:08:24 +0200 Subject: [PATCH] Berry `web_add_handler` called before `Webserver` is initialized (#21272) --- CHANGELOG.md | 1 + tasmota/tasmota_xdrv_driver/xdrv_52_9_berry.ino | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 20dd8fef4..63bea0fb9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ All notable changes to this project will be documented in this file. - LVGL restore `lv_palette` functions - IPv6 support in safeboot - LVGL fix memory allocation of flush buffers +- Berry `web_add_handler` called before `Webserver` is initialized ### Removed - LVGL disabled vector graphics diff --git a/tasmota/tasmota_xdrv_driver/xdrv_52_9_berry.ino b/tasmota/tasmota_xdrv_driver/xdrv_52_9_berry.ino index 78e2a097a..2205b214f 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_52_9_berry.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_52_9_berry.ino @@ -899,7 +899,7 @@ bool Xdrv52(uint32_t function) #ifdef USE_ETHERNET network_up = network_up || EthernetHasIP(); #endif - if (network_up) { // if network is already up, send a synthetic event to trigger web handlers + if (network_up && (Webserver != NULL)) { // if network is already up, send a synthetic event to trigger web handlers callBerryEventDispatcher(PSTR("web_add_handler"), nullptr, 0, nullptr); berry.web_add_handler_done = true; }