From 655a1d4f170fff1689ac3dcdbda6c79ff1c85409 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20=C3=84lgmyr?= Date: Sat, 9 Oct 2021 17:08:45 +0200 Subject: [PATCH 1/3] Fix crash on pattern load (#319) --- source/views/view_pattern_editor.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/views/view_pattern_editor.cpp b/source/views/view_pattern_editor.cpp index 2608679..734b94f 100644 --- a/source/views/view_pattern_editor.cpp +++ b/source/views/view_pattern_editor.cpp @@ -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()); @@ -417,4 +419,4 @@ namespace hex { } -} \ No newline at end of file +} -- 2.33.1