From f889997cee1aaa8e7e69e63b221482ad47428431 Mon Sep 17 00:00:00 2001 From: shun-iwasawa Date: Oct 18 2018 05:44:14 +0000 Subject: check folder access on save level (#2334) --- diff --git a/toonz/sources/toonzlib/txshsimplelevel.cpp b/toonz/sources/toonzlib/txshsimplelevel.cpp index c4f7af0..b22ae35 100644 --- a/toonz/sources/toonzlib/txshsimplelevel.cpp +++ b/toonz/sources/toonzlib/txshsimplelevel.cpp @@ -1391,7 +1391,10 @@ void TXshSimpleLevel::save(const TFilePath &fp, const TFilePath &oldFp, (!oldFp.isEmpty()) ? oldFp : getScene()->decodeFilePath(m_path); TFilePath dDstPath = getScene()->decodeFilePath(fp); - TSystem::touchParentDir(dDstPath); + if (!TSystem::touchParentDir(dDstPath)) + throw TSystemException( + dDstPath, + "The level cannot be saved: failed to access the target folder."); // backup if (Preferences::instance()->isLevelsBackupEnabled() &&