From 10114716be956ffc45eeeda3f0bd8383147c5364 Mon Sep 17 00:00:00 2001 From: 0neGal Date: Sun, 29 Jan 2023 22:25:02 +0100 Subject: only search libraries if they are a folder 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. --- src/modules/find.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') 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]+/)) { -- cgit v1.2.3