dromara / dromara/TLog

TLogWebInvokeTimeInterceptor 统计请求执行时间时 出现 NullPointerException

Open
#21 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
601
Forks
117
PR merge metrics
No merged PRs in 30d

Description

您好,我在使用Tlog 的过程中,在项目内部使用请求转发时,TLogWebInvokeTimeInterceptor 内部出现了空指针异常,同一个请求进入了2次TLogWebInvokeTimeInterceptor,第二次进入TLogWebInvokeTimeInterceptor 可以从 invokeTimeTL 拿到 StopWatch ,并打印时间,最后remove。随之第一次进入TLogWebInvokeTimeInterceptor 的也会去从 invokeTimeTL 获取stopWatch,因为被线程remove掉了,所以拿到的stopWatch为空,最后调用stopWatch.stop() 方法出现了空指针,堆栈信息如下。
![image](https://github.com/dromara/TLog/assets/54424470/ce979b17-51c2-4479-b1f3-364d648f80d9)
源码这边是否可以判空一下。

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.