aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2024-05-31 16:14:12 +0200
committer0neGal <mail@0negal.com>2024-05-31 16:14:12 +0200
commit9f7a4cf5a7ff45ebad524aa7ec6edc60cd84cfb1 (patch)
treeca11a0ba256e141b15dee455bc4459238bfc2184 /src
parent271d6e86e91b3e91765152154439cc33627e1e06 (diff)
downloadViper-9f7a4cf5a7ff45ebad524aa7ec6edc60cd84cfb1.tar.gz
Viper-9f7a4cf5a7ff45ebad524aa7ec6edc60cd84cfb1.zip
fixed error when enabledmods.json cant be parsed
Diffstat (limited to 'src')
-rw-r--r--src/modules/mods.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/modules/mods.js b/src/modules/mods.js
index 169e7b1..6214098 100644
--- a/src/modules/mods.js
+++ b/src/modules/mods.js
@@ -350,6 +350,10 @@ mods.modfile.get = (mod) => {
// read enabledmods.json
let data = json(mods.modfile.file);
+ if (! data || typeof data !== "object") {
+ return true;
+ }
+
if (data[mod]) { // enabled
return true;
} else if (data[mod] === false) { // disabled