From 6ed8c0e2313374a4cb546d3f5d1e8fe22ef58f54 Mon Sep 17 00:00:00 2001 From: Elias Fierke Date: Sat, 19 Sep 2026 20:15:56 +0200 Subject: [PATCH] [fix:] default module config was wrong --- DataStore/SchemaMigration.cs | 3 +-- DataStore/Settings.cs | 6 +++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/DataStore/SchemaMigration.cs b/DataStore/SchemaMigration.cs index ebbf1cd..2c32d65 100644 --- a/DataStore/SchemaMigration.cs +++ b/DataStore/SchemaMigration.cs @@ -99,8 +99,7 @@ public static class SchemaMigration // Example: Add a new field that didn't exist before if (!obj.ContainsKey("moduleConfig")) { - string deflt = JsonConvert.SerializeObject(new ModuleConfig()); - obj["moduleConfig"] = default; + obj["moduleConfig"] = JToken.FromObject(new ModuleConfig()); } return obj; diff --git a/DataStore/Settings.cs b/DataStore/Settings.cs index a061eda..b81e7ba 100644 --- a/DataStore/Settings.cs +++ b/DataStore/Settings.cs @@ -20,7 +20,7 @@ public class Settings public Customers customers = new(); public PdfExportSettings pdfExport { get; set; } = new(); - public ModuleConfig moduleConfig { get; set; } = new(); + public ModuleConfig moduleConfig { get; set; } = new ModuleConfig(); public Settings() { @@ -79,6 +79,10 @@ public class ModuleConfig /// Contains enabled modules and whether it's password-protected or not (non-existing-feature but soon) /// public List<(LCModule, bool)> EnabledModules = new(); + public ModuleConfig() + { + EnabledModules = new List<(LCModule,bool)>(); + } } public enum LCModule