From f944da4ba8fb7b96120cca5ec86fe9916b454b6c Mon Sep 17 00:00:00 2001
From: zhangdaiscott <zhangdaiscott@163.com>
Date: Sun, 27 Dec 2020 21:32:26 +0800
Subject: [PATCH] sysUser中rel_tenant_ids为空时,可能导致MybatisPlusConfig中出现空指针异常

---
 jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/mybatis/MybatisPlusConfig.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/mybatis/MybatisPlusConfig.java b/jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/mybatis/MybatisPlusConfig.java
index bbab8a0..56abfba 100644
--- a/jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/mybatis/MybatisPlusConfig.java
+++ b/jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/mybatis/MybatisPlusConfig.java
@@ -12,6 +12,7 @@ import net.sf.jsqlparser.expression.operators.relational.ExpressionList;
 import net.sf.jsqlparser.expression.operators.relational.InExpression;
 import net.sf.jsqlparser.schema.Column;
 import org.apache.ibatis.reflection.MetaObject;
+import org.jeecg.common.util.oConvertUtils;
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
@@ -72,7 +73,7 @@ public class MybatisPlusConfig {
 
             @Override
             public Expression getTenantId(boolean select) {
-                String tenant_id = TenantContext.getTenant();
+                String tenant_id = oConvertUtils.getString(TenantContext.getTenant(),"0");
                 return new LongValue(tenant_id);
             }
             @Override
--
libgit2 0.22.2