Skip to content

Commit 721c0dc

Browse files
authored
Make language settings more robust.
Added bound check for the current language. If a user downgrades a firmware, the active language could go out of bounds (if the older firmware has less supported languages).
1 parent 0cf2361 commit 721c0dc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fw/application/src/main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,9 @@ int main(void) {
277277

278278
NRF_LOG_DEBUG("init done");
279279

280+
if (p_settings->language >= LANGUAGE_COUNT) {
281+
p_settings->language = LANGUAGE_EN_US;
282+
}
280283
setLanguage(p_settings->language);
281284

282285
mui_t *p_mui = mui();

0 commit comments

Comments
 (0)