Fix crash if screenshot folder already existed

This commit is contained in:
Alexander Bock
2018-02-28 15:32:16 -05:00
parent 35fd2f79a8
commit cf8371f304

View File

@@ -321,7 +321,10 @@ void mainInitFunc() {
strftime(mbstr, sizeof(mbstr), "%Y-%m-%d-%H-%M", nowTime);
screenshotPath += "/" + std::string(mbstr);
FileSys.createDirectory(absPath(screenshotPath));
std::string p = absPath(screenshotPath);
if (!FileSys.directoryExists(p)) {
FileSys.createDirectory(p);
}
}
for (size_t i = 0; i < nWindows; ++i) {