mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-05 06:22:45 +01:00
Common: Return from CreateFullPath early if the directory creation fails
This commit is contained in:
parent
a59f57d504
commit
a7c7946867
1 changed files with 4 additions and 2 deletions
|
@ -190,8 +190,10 @@ bool CreateFullPath(const std::string &fullPath)
|
||||||
|
|
||||||
// Include the '/' so the first call is CreateDir("/") rather than CreateDir("")
|
// Include the '/' so the first call is CreateDir("/") rather than CreateDir("")
|
||||||
std::string const subPath(fullPath.substr(0, position + 1));
|
std::string const subPath(fullPath.substr(0, position + 1));
|
||||||
if (!FileUtil::IsDirectory(subPath))
|
if (!FileUtil::IsDirectory(subPath) && !FileUtil::CreateDir(subPath)) {
|
||||||
FileUtil::CreateDir(subPath);
|
ERROR_LOG(COMMON, "CreateFullPath: directory creation failed");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// A safety check
|
// A safety check
|
||||||
panicCounter--;
|
panicCounter--;
|
||||||
|
|
Loading…
Reference in a new issue