From 85c07dba9cd517c7eea2033ebac06c0d8f4ea7eb Mon Sep 17 00:00:00 2001 From: antelle Date: Mon, 9 Mar 2020 16:33:18 +0100 Subject: [PATCH] checking if the directory exists, see #1418 --- desktop/app.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/desktop/app.js b/desktop/app.js index c13c722b..10636b8f 100644 --- a/desktop/app.js +++ b/desktop/app.js @@ -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 {