From eed3d8b18d08cdd9f4eb58d71ee09da2d288c38e Mon Sep 17 00:00:00 2001 From: Xuing Date: Wed, 8 Mar 2023 20:16:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DContextHolder=E7=9A=84NPE?= =?UTF-8?q?=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/db/DataPermissionDatabaseInterceptor.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/db/DataPermissionDatabaseInterceptor.java b/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/db/DataPermissionDatabaseInterceptor.java index 5fc4e55d0..6e5564865 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/db/DataPermissionDatabaseInterceptor.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/db/DataPermissionDatabaseInterceptor.java @@ -539,11 +539,11 @@ public class DataPermissionDatabaseInterceptor extends JsqlParserSupport impleme /** * 该 {@link MappedStatement} 对应的规则 */ - private static final ThreadLocal> RULES = new TransmittableThreadLocal<>(); + private static final ThreadLocal> RULES = ThreadLocal.withInitial(Collections::emptyList); /** * SQL 是否进行重写 */ - private static final ThreadLocal REWRITE = new TransmittableThreadLocal<>(); + private static final ThreadLocal REWRITE = ThreadLocal.withInitial(() -> Boolean.FALSE); public static void init(List rules) { RULES.set(rules);