From 7282b562fad0f7ca5e3bb8c04f07a3db4c9066ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Thu, 31 Mar 2022 14:59:42 +0200 Subject: [PATCH] Fix Crash if no texts defined but plugin enabled --- src/modules/CannedMessageModule.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/modules/CannedMessageModule.cpp b/src/modules/CannedMessageModule.cpp index 1db82e903..aa52cf6cd 100644 --- a/src/modules/CannedMessageModule.cpp +++ b/src/modules/CannedMessageModule.cpp @@ -307,6 +307,12 @@ void CannedMessageModule::drawFrame( display->setFont(FONT_MEDIUM); display->drawString(display->getWidth()/2 + x, 0 + y + 12, "Sending..."); } + else if (cannedMessageModule->runState == CANNED_MESSAGE_RUN_STATE_DISABLED) + { + display->setTextAlignment(TEXT_ALIGN_LEFT); + display->setFont(FONT_SMALL); + display->drawString(10 + x, 0 + y + 16, "Canned Message\nModule disabled."); + } else { display->setTextAlignment(TEXT_ALIGN_LEFT);