diff --git a/OBSApi/Utility/XFile_Windows.cpp b/OBSApi/Utility/XFile_Windows.cpp index 3e5aa663f..6d36caa03 100644 --- a/OBSApi/Utility/XFile_Windows.cpp +++ b/OBSApi/Utility/XFile_Windows.cpp @@ -379,8 +379,13 @@ BOOL CreatePath(CTSTR lpPath) if(OSCreateDirectory(lpPath)) return true; else - if(!CreatePath(GetPathDirectory(lpPath))) + { + String parent = GetPathDirectory(lpPath); + if (parent == lpPath) + return false; + if (!CreatePath(parent)) return false; + } return OSCreateDirectory(lpPath); }