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
1 changed files with 3 additions and 1 deletions

View File

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