Fix: ignore non-existent magic directories (#215)
This commit is contained in:
parent
2f19ff768d
commit
0168a3b741
@ -105,6 +105,9 @@ namespace hex {
|
||||
|
||||
std::error_code error;
|
||||
for (const auto &dir : hex::getPath(ImHexPath::Magic)) {
|
||||
if (!std::filesystem::is_directory(dir))
|
||||
continue;
|
||||
|
||||
for (const auto &entry : std::filesystem::directory_iterator(dir, error)) {
|
||||
if (entry.is_regular_file() && entry.path().extension() == ".mgc")
|
||||
magicFiles += entry.path().string() + MAGIC_PATH_SEPARATOR;
|
||||
|
Loading…
Reference in New Issue
Block a user