1
0
mirror of synced 2024-11-28 01:20:51 +01:00

Fix: ignore non-existent magic directories (#215)

This commit is contained in:
ThisALV 2021-04-03 17:08:16 +02:00 committed by GitHub
parent 2f19ff768d
commit 0168a3b741
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;