From 4c8cd290b5e18efad6f7fc4b7fc767a1bf2b8cc3 Mon Sep 17 00:00:00 2001 From: 502647092 Date: Sat, 10 Sep 2016 00:44:27 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E6=B3=A8=E5=85=A5?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E7=9A=84Null=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 502647092 --- .../java/pw/yumc/YumCore/config/AbstractInjectConfig.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/pw/yumc/YumCore/config/AbstractInjectConfig.java b/src/main/java/pw/yumc/YumCore/config/AbstractInjectConfig.java index 878c59c..4d19acd 100644 --- a/src/main/java/pw/yumc/YumCore/config/AbstractInjectConfig.java +++ b/src/main/java/pw/yumc/YumCore/config/AbstractInjectConfig.java @@ -28,6 +28,10 @@ public abstract class AbstractInjectConfig { * 注入配置数据 */ public void inject(final ConfigurationSection config) { + if (config == null) { + Log.warning("尝试注入 ConfigurationSection 为 Null 的数据!"); + return; + } this.config = config; for (final Field field : getClass().getDeclaredFields()) { if (Modifier.isTransient(field.getModifiers()) || field.getType().isPrimitive()) {