diff --git a/src/helpers.cpp b/src/helpers.cpp index a52b5fbfb..7e0ab3843 100644 --- a/src/helpers.cpp +++ b/src/helpers.cpp @@ -707,6 +707,11 @@ std::string Helpers::translated_word(const char * const * strings, bool to_lower uint8_t language_index = EMSESP::system_.language_index(); uint8_t index = 0; + // check for empty + if (!strings) { + return ""; // it's a nullptr with no translations, return empty to prevent unwanted crash + } + // see how many translations we have for this entity. if there is no translation for this, revert to EN if (Helpers::count_items(strings) >= language_index + 1 && strlen(strings[language_index])) { index = language_index;