Skip to content

Commit

Permalink
Check if language pack metadata are valid
Browse files Browse the repository at this point in the history
  • Loading branch information
tbnobody committed Oct 21, 2024
1 parent 68c87c9 commit 2e23c7e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/I18n.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

0 comments on commit 2e23c7e

Please sign in to comment.