- fix: NullPointerException when the config class of mod updated

- alter: better test code in `common/src/test`, `neoforge/src/test` and `fabric/src/test`, run `Test Minecraft Client(:fabric)` or `Test Minecraft Client(:neoforge)` for testing
This commit is contained in:
Jaffe2718
2025-09-11 11:48:26 +08:00
parent 78c462dc1c
commit c775a9d221
18 changed files with 167 additions and 62 deletions

View File

@@ -132,7 +132,7 @@ public abstract class MidnightConfig {
entries.values().forEach(info -> {
if (info.field != null && info.entry != null) {
try {
info.value = info.field.get(null);
info.value = info.field.get(null) == null ? info.defaultValue : info.field.get(null);
info.tempValue = info.toTemporaryValue();
info.updateConditions();
} catch (IllegalAccessException ignored) {}