diff --git a/stepmania/src/RageFileDriverDirectHelpers.cpp b/stepmania/src/RageFileDriverDirectHelpers.cpp index e8355fe712..3d7b5f75e9 100644 --- a/stepmania/src/RageFileDriverDirectHelpers.cpp +++ b/stepmania/src/RageFileDriverDirectHelpers.cpp @@ -164,8 +164,7 @@ bool CreateDirectories( RString Path ) /* Make sure it's a directory. */ struct stat st; - DoStat( curpath, &st ); - if( !(st.st_mode & S_IFDIR) ) + if( DoStat(curpath, &st) != -1 && !(st.st_mode & S_IFDIR) ) { WARN( ssprintf("Couldn't create %s: path exists and is not a directory", curpath.c_str()) );