Skip to content

Commit

Permalink
Berry avoid crash when Berry is disabled after bootloop (#21235)
Browse files Browse the repository at this point in the history
  • Loading branch information
s-hadinger authored Apr 21, 2024
1 parent c4431eb commit 5ecd45e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tasmota/tasmota_xdrv_driver/xdrv_52_9_berry.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 5ecd45e

Please sign in to comment.