aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2023-01-29 22:25:02 +0100
committer0neGal <mail@0negal.com>2023-01-29 22:25:02 +0100
commit10114716be956ffc45eeeda3f0bd8383147c5364 (patch)
tree8dc7e32c0a8abbbf13a753f5a58f84ea2991a53c /src
parent052d121b06021729274ee7ac68b3d306c968687d (diff)
downloadViper-10114716be956ffc45eeeda3f0bd8383147c5364.tar.gz
Viper-10114716be956ffc45eeeda3f0bd8383147c5364.zip
only search libraries if they are a folderlinux-launch
Steam's library list may be outdated, or a drive may not be mounted currently, however we would still attempt to read the folder that doesn't currently exist, causing an error.
Diffstat (limited to 'src')
-rw-r--r--src/modules/find.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/modules/find.js b/src/modules/find.js
index 25c1b38..8ed565e 100644
--- a/src/modules/find.js
+++ b/src/modules/find.js
@@ -46,6 +46,12 @@ module.exports = {
let protonpath = false;
for (let i = 0; i < libraries.length; i++) {
+ if (! fs.existsSync(libraries[i])
+ || fs.statSync(libraries[i]).isDirectory()) {
+
+ continue;
+ }
+
let files = fs.readdirSync(libraries[i]);
for (let ii = 0; ii < files.length; ii++) {
if (files[ii].match(/^Proton [0-9]+\.[0-9]+/)) {