From da48f1741ce8e6a3930fba3766bfa3451c96dd98 Mon Sep 17 00:00:00 2001 From: Keuin Date: Sun, 21 Jan 2024 15:04:14 +0800 Subject: feature: validate config --- src/main/java/com/keuin/kbackupfabric/config/KBackupConfig.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/main/java/com/keuin/kbackupfabric/config/KBackupConfig.java b/src/main/java/com/keuin/kbackupfabric/config/KBackupConfig.java index 8ce5ed4..c47645b 100644 --- a/src/main/java/com/keuin/kbackupfabric/config/KBackupConfig.java +++ b/src/main/java/com/keuin/kbackupfabric/config/KBackupConfig.java @@ -38,6 +38,14 @@ public class KBackupConfig { ObjectWriter w = om.writerWithDefaultPrettyPrinter(); w.writeValue(file, instance); } + validate(instance); + } + + private static void validate(KBackupConfig cfg) { + if (cfg.incbakCow == null) { + PrintUtil.warn("incbak_cow could not be null"); + cfg.incbakCow = false; + } } public static void load() throws IOException { -- cgit v1.2.3