diff --git a/main.js b/main.js index bae82cc..716d4db 100644 --- a/main.js +++ b/main.js @@ -90,6 +90,8 @@ ipcMain.handle('import-data', async () => { if (canceled || !filePaths) return - await fs.unlink(dataPath) + if(await fileExists(dataPath)) { + await fs.unlink(dataPath) + } await fs.copyFile(filePaths[0], dataPath,fs.constants.COPYFILE_EXCL) }) \ No newline at end of file