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:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user