From a5560962bce8fa7ff451f1997a15ce2da0e98eb6 Mon Sep 17 00:00:00 2001 From: Daniel Ceregatti Date: Sun, 15 Oct 2023 12:01:26 -0700 Subject: [PATCH] Fix issue where a fresh install's web UI returns an error because the mods directory does not exist. --- web/web.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web/web.js b/web/web.js index ccecf74..817e0c6 100644 --- a/web/web.js +++ b/web/web.js @@ -145,6 +145,7 @@ const getDirSize = (dirPath) => { const getCustomXML = (modId) => { const ret = [] + if (! fs.existsSync(config.modDir)) return ret for(const file of configFiles) { if (fs.existsSync(config.modDir + d + modId + d + file)) { ret.push({name:file}) @@ -166,6 +167,7 @@ const getModNameById = (id) => { const getMods = () => { const mods = [] + if (! fs.existsSync(config.modDir)) return mods fs.readdirSync(config.modDir).forEach(file => { const name = getModNameById(file) mods.push({name:name,id:file})