From 5ecd45e2dab189eea723693d68428984bd5c0a56 Mon Sep 17 00:00:00 2001 From: s-hadinger <49731213+s-hadinger@users.noreply.github.com> Date: Sun, 21 Apr 2024 10:03:55 +0200 Subject: [PATCH] Berry avoid crash when Berry is disabled after bootloop (#21235) --- tasmota/tasmota_xdrv_driver/xdrv_52_9_berry.ino | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tasmota/tasmota_xdrv_driver/xdrv_52_9_berry.ino b/tasmota/tasmota_xdrv_driver/xdrv_52_9_berry.ino index c31ee9f04998..78e2a097af80 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_52_9_berry.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_52_9_berry.ino @@ -782,6 +782,7 @@ void HandleBerryConsole(void) // Display Buttons to dynamically load bec files void HandleBerryBECLoaderButton(void) { bvm * vm = berry.vm; + if (vm == NULL) { return; } // Berry vm is not initialized for (int32_t i = 0; i < ARRAY_SIZE(BECCode); i++) { const BeBECCode_t &bec = BECCode[i]; @@ -946,7 +947,7 @@ bool Xdrv52(uint32_t function) case FUNC_WEB_ADD_CONSOLE_BUTTON: if (XdrvMailbox.index) { XdrvMailbox.index++; - } else { + } else if (berry.vm != NULL) { WSContentSend_P(HTTP_BTN_BERRY_CONSOLE); HandleBerryBECLoaderButton(); // display buttons to load BEC files callBerryEventDispatcher(PSTR("web_add_button"), nullptr, 0, nullptr);