mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-12-03 19:35:38 +00:00
Fixed an issue where placing a directory with no access permissions inside a system folder crashed the application on startup
This commit is contained in:
parent
ce580a269f
commit
d380db8a1f
|
@ -67,6 +67,7 @@ namespace Utils
|
||||||
if (!isDirectory(genericPath))
|
if (!isDirectory(genericPath))
|
||||||
return contentList;
|
return contentList;
|
||||||
|
|
||||||
|
try {
|
||||||
if (recursive) {
|
if (recursive) {
|
||||||
#if defined(_WIN64)
|
#if defined(_WIN64)
|
||||||
for (auto& entry : std::filesystem::recursive_directory_iterator(
|
for (auto& entry : std::filesystem::recursive_directory_iterator(
|
||||||
|
@ -91,6 +92,18 @@ namespace Utils
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
catch (...) {
|
||||||
|
#if defined(_WIN64)
|
||||||
|
LOG(LogError) << "FileSystemUtil::getDirContent(): Couldn't read directory " << "\""
|
||||||
|
<< Utils::String::replace(path, "/", "\\")
|
||||||
|
<< "\", permission problems?";
|
||||||
|
#else
|
||||||
|
LOG(LogError) << "FileSystemUtil::getDirContent(): Couldn't read directory " << "\""
|
||||||
|
<< path << "\", permission problems?";
|
||||||
|
#endif
|
||||||
|
return contentList;
|
||||||
|
}
|
||||||
|
|
||||||
contentList.sort();
|
contentList.sort();
|
||||||
return contentList;
|
return contentList;
|
||||||
|
|
Loading…
Reference in a new issue