diff options
author | 0neGal <mail@0negal.com> | 2023-01-29 22:25:02 +0100 |
---|---|---|
committer | 0neGal <mail@0negal.com> | 2023-01-29 22:25:02 +0100 |
commit | 10114716be956ffc45eeeda3f0bd8383147c5364 (patch) | |
tree | 8dc7e32c0a8abbbf13a753f5a58f84ea2991a53c | |
parent | 052d121b06021729274ee7ac68b3d306c968687d (diff) | |
download | Viper-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.
-rw-r--r-- | src/modules/find.js | 6 |
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]+/)) { |