From 11963ea3d2bb9ff29fd56340347343899923c273 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Sun, 28 Dec 2025 09:48:32 -0600 Subject: [PATCH] Screen crash fix --- src/mesh/MeshService.cpp | 4 ++-- src/modules/TextMessageModule.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mesh/MeshService.cpp b/src/mesh/MeshService.cpp index c63e6d2d2..6bc8ccb50 100644 --- a/src/mesh/MeshService.cpp +++ b/src/mesh/MeshService.cpp @@ -196,8 +196,8 @@ void MeshService::handleToRadio(meshtastic_MeshPacket &p) p.rx_time = getValidTime(RTCQualityFromNet); // Record the time the packet arrived from the phone #if HAS_SCREEN - if (p.decoded.portnum == meshtastic_PortNum_TEXT_MESSAGE_APP && p.decoded.payload.size > 0 && p.to != NODENUM_BROADCAST && - p.to != 0) // DM only + if (screen && p.decoded.portnum == meshtastic_PortNum_TEXT_MESSAGE_APP && p.decoded.payload.size > 0 && + p.to != NODENUM_BROADCAST && p.to != 0) // DM only { perhapsDecode(&p); const StoredMessage &sm = messageStore.addFromPacket(p); diff --git a/src/modules/TextMessageModule.cpp b/src/modules/TextMessageModule.cpp index 76e063436..b05d5a52e 100644 --- a/src/modules/TextMessageModule.cpp +++ b/src/modules/TextMessageModule.cpp @@ -23,7 +23,7 @@ ProcessMessage TextMessageModule::handleReceived(const meshtastic_MeshPacket &mp devicestate.has_rx_text_message = true; #if HAS_SCREEN // Guard against running in MeshtasticUI - if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR) { + if (screen && config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR) { // Store in the central message history const StoredMessage &sm = messageStore.addFromPacket(mp);