1
0
mirror of synced 2024-11-15 11:33:23 +01:00

Fix crash on pattern load (#319)

This commit is contained in:
Anton Älgmyr 2021-10-09 17:08:45 +02:00 committed by GitHub
parent 2dc1886ee9
commit 21769886fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -191,6 +191,8 @@ namespace hex {
this->m_possiblePatternFiles.clear(); this->m_possiblePatternFiles.clear();
for (auto &imhexPath : hex::getPath(ImHexPath::Patterns)) { for (auto &imhexPath : hex::getPath(ImHexPath::Patterns)) {
if (!fs::exists(imhexPath)) continue;
for (auto &entry: fs::recursive_directory_iterator(imhexPath)) { for (auto &entry: fs::recursive_directory_iterator(imhexPath)) {
if (entry.is_regular_file() && entry.path().extension() == ".hexpat") { if (entry.is_regular_file() && entry.path().extension() == ".hexpat") {
this->m_possiblePatternFiles.push_back(entry.path()); this->m_possiblePatternFiles.push_back(entry.path());