From 2e23c7e0ae154113f988e3bd289e6939cfe2ab7d Mon Sep 17 00:00:00 2001 From: Thomas Basler Date: Mon, 21 Oct 2024 19:10:54 +0200 Subject: [PATCH] Check if language pack metadata are valid --- src/I18n.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/I18n.cpp b/src/I18n.cpp index 1fb49cfad..0827ed12d 100644 --- a/src/I18n.cpp +++ b/src/I18n.cpp @@ -75,11 +75,15 @@ void I18nClass::readConfig(String file) } LanguageInfo_t lang; - lang.code = String(doc["meta"]["code"]); - lang.name = String(doc["meta"]["name"]); + lang.code = String(doc["meta"]["code"] | ""); + lang.name = String(doc["meta"]["name"] | ""); lang.filename = file; - _availLanguages.push_back(lang); + if (lang.code != "" && lang.name != "") { + _availLanguages.push_back(lang); + } else { + MessageOutput.printf("Invalid meta data\r\n"); + } f.close(); }