1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-11 11:08:02 -06:00

Avoid assert by verifying installed languages exist (#1354)

wxDir::GetAllFiles will throw an assert when opening the preferences dialog
if for some reason the user has not installed VeraCrypt properly and is
missing the intended folder. This patch adds a check to ensure the folder
first exists before querying its files.
This commit is contained in:
Jertzukka
2024-06-04 00:10:53 +03:00
committed by GitHub
parent ea7489b93b
commit bf9f3ec4f0

View File

@@ -82,6 +82,7 @@ namespace VeraCrypt
LanguageListBox->Append("System default");
LanguageListBox->Append("English");
if (wxDir::Exists(languagesFolder.GetName())) {
size_t langCount;
langCount = wxDir::GetAllFiles(languagesFolder.GetName(), &langArray, wxEmptyString, wxDIR_FILES);
for (size_t i = 0; i < langCount; ++i) {
@@ -92,6 +93,7 @@ namespace VeraCrypt
LanguageListBox->Append(langNative);
}
}
}
#endif