From 9f7a4cf5a7ff45ebad524aa7ec6edc60cd84cfb1 Mon Sep 17 00:00:00 2001 From: 0neGal Date: Fri, 31 May 2024 16:14:12 +0200 Subject: fixed error when enabledmods.json cant be parsed --- src/modules/mods.js | 4 ++++ 1 file changed, 4 insertions(+) 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 -- cgit v1.2.3