checking if the directory exists, see #1418

This commit is contained in:
antelle 2020-03-09 16:33:18 +01:00
parent 7ace45929a
commit 85c07dba9c
1 changed files with 3 additions and 1 deletions

View File

@ -471,7 +471,9 @@ function restorePreferences() {
const oldProfilePath = path.join(tempUserDataPath, oldProfile.dir);
const newProfilePath = path.join(tempUserDataPath, newProfile.dir);
if (fs.existsSync(path.join(oldProfilePath, 'Cookies'))) {
fs.mkdirSync(newProfilePath);
if (!fs.existsSync(newProfilePath)) {
fs.mkdirSync(newProfilePath);
}
const cookiesFileSrc = path.join(oldProfilePath, 'Cookies');
const cookiesFileDest = path.join(newProfilePath, 'Cookies');
try {