mirror of
https://github.com/fanchenio/DawnLauncher.git
synced 2025-07-14 05:12:11 +08:00
fixed an issue that caused the program to crash if the item did not exist when opening the item.
This commit is contained in:
parent
d117397dc3
commit
e7ce285ae9
@ -318,11 +318,15 @@ function execute(
|
||||
// 工作目录
|
||||
let currentDir = startLocation;
|
||||
if (!currentDir || currentDir.trim() === "") {
|
||||
let statRes = statSync(file);
|
||||
if (statRes.isDirectory()) {
|
||||
currentDir = file;
|
||||
} else {
|
||||
currentDir = dirname(file);
|
||||
try {
|
||||
let statRes = statSync(file);
|
||||
if (statRes.isDirectory()) {
|
||||
currentDir = file;
|
||||
} else {
|
||||
currentDir = dirname(file);
|
||||
}
|
||||
} catch (e) {
|
||||
currentDir = app.getPath("home");
|
||||
}
|
||||
}
|
||||
// 组装命令
|
||||
|
Loading…
Reference in New Issue
Block a user