Add check for relocation or non-existent folder before performing diff
This commit is contained in:
3
main.js
3
main.js
@@ -856,6 +856,9 @@ app.whenReady().then(() => {
|
|||||||
});
|
});
|
||||||
// Diff
|
// Diff
|
||||||
ipcMain.handle('diff-commit', async (_e, folderObj, hash) => {
|
ipcMain.handle('diff-commit', async (_e, folderObj, hash) => {
|
||||||
|
if (folderObj.needsRelocation || !fs.existsSync(folderObj.path)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const git = simpleGit(folderObj.path);
|
const git = simpleGit(folderObj.path);
|
||||||
return git.diff([`${hash}^!`]);
|
return git.diff([`${hash}^!`]);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user