From 9ae7cc35744b3aa032dc20efeb1b4df463ceb7ab Mon Sep 17 00:00:00 2001 From: 0neGal Date: Sun, 17 Apr 2022 20:02:18 +0200 Subject: fixed gamepathlost errors on first launch Because viper.json doesn't exist it also means settings.gamepath is null, which triggers the gamepathlost message. --- src/utils.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/utils.js b/src/utils.js index 6a45bd7..89bcf92 100644 --- a/src/utils.js +++ b/src/utils.js @@ -787,7 +787,11 @@ setInterval(() => { if (gamepathExists()) { ipcMain.emit("guigetmods"); } else { - ipcMain.emit("gamepathlost"); + if (fs.existsSync("viper.json")) { + if (settings.gamepath != "") { + ipcMain.emit("gamepathlost"); + } + } } }, 1500) -- cgit v1.2.3