From 03b0f839cfc03e9f3ea228514a86154fcf990832 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=80=E6=BA=90=E6=B5=B7=E5=93=A5?= Date: Tue, 17 Oct 2023 19:57:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90?= =?UTF-8?q?=E5=99=A8=E4=B8=BA=E5=81=9A=E8=87=AA=E5=AE=9A=E4=B9=89=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=97=B6=EF=BC=8C=E7=94=9F=E6=88=90=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=20NPE=20=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=9B=20close=20#I88UIZ?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mybatisflex/codegen/config/GlobalConfig.java | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/mybatis-flex-codegen/src/main/java/com/mybatisflex/codegen/config/GlobalConfig.java b/mybatis-flex-codegen/src/main/java/com/mybatisflex/codegen/config/GlobalConfig.java index 4acdfc34..a0be3c2c 100644 --- a/mybatis-flex-codegen/src/main/java/com/mybatisflex/codegen/config/GlobalConfig.java +++ b/mybatis-flex-codegen/src/main/java/com/mybatisflex/codegen/config/GlobalConfig.java @@ -53,9 +53,8 @@ public class GlobalConfig implements Serializable { private TableDefConfig tableDefConfig; private MapperXmlConfig mapperXmlConfig; - // === 其他配置 === - - private Map customConfig; + // === 其他自定义配置 === + private Map customConfig = new HashMap<>(); // === 是否启用生成 === @@ -220,16 +219,10 @@ public class GlobalConfig implements Serializable { // === 自定义配置 === public Object getCustomConfig(String key) { - if (customConfig != null) { - return customConfig.get(key); - } - return null; + return customConfig.get(key); } public void setCustomConfig(String key, Object value) { - if (customConfig == null) { - customConfig = new HashMap<>(); - } customConfig.put(key, value); }