Fixes critical error rendering before screen thread is running (#5024)

* Fixes critical error rendering before screen thread is running

* Fix GPS thread crashing on probe code attempting to %s print an enum

* 10
This commit is contained in:
Ben Meadors
2024-10-10 14:58:42 -05:00
committed by GitHub
co-authored by GitHub
parent b769799410
commit e8f287a36f
2 changed files with 9 additions and 8 deletions
+3 -2
View File
@@ -1206,7 +1206,8 @@ void recordCriticalError(meshtastic_CriticalErrorCode code, uint32_t address, co
{
// Print error to screen and serial port
String lcd = String("Critical error ") + code + "!\n";
screen->print(lcd.c_str());
if (screen)
screen->print(lcd.c_str());
if (filename) {
LOG_ERROR("NOTE! Recording critical error %d at %s:%lu\n", code, filename, address);
} else {
@@ -1222,4 +1223,4 @@ void recordCriticalError(meshtastic_CriticalErrorCode code, uint32_t address, co
LOG_ERROR("A critical failure occurred, portduino is exiting...");
exit(2);
#endif
}
}