From 3859516fe60f33e154226b01c87bf34cb2d65ce2 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Sun, 25 May 2025 05:19:54 +0200 Subject: [PATCH] Add check for relocation or non-existent folder before performing diff --- main.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.js b/main.js index ee4b6ab..988701c 100644 --- a/main.js +++ b/main.js @@ -856,6 +856,9 @@ app.whenReady().then(() => { }); // Diff ipcMain.handle('diff-commit', async (_e, folderObj, hash) => { + if (folderObj.needsRelocation || !fs.existsSync(folderObj.path)) { + return; + } const git = simpleGit(folderObj.path); return git.diff([`${hash}^!`]); });