diff options
author | 0neGal <mail@0negal.com> | 2024-05-31 16:14:12 +0200 |
---|---|---|
committer | 0neGal <mail@0negal.com> | 2024-05-31 16:14:12 +0200 |
commit | 9f7a4cf5a7ff45ebad524aa7ec6edc60cd84cfb1 (patch) | |
tree | ca11a0ba256e141b15dee455bc4459238bfc2184 | |
parent | 271d6e86e91b3e91765152154439cc33627e1e06 (diff) | |
download | Viper-9f7a4cf5a7ff45ebad524aa7ec6edc60cd84cfb1.tar.gz Viper-9f7a4cf5a7ff45ebad524aa7ec6edc60cd84cfb1.zip |
fixed error when enabledmods.json cant be parsed
-rw-r--r-- | src/modules/mods.js | 4 |
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 |