From 2a4452f839c7caaa3918639ca6bc6bdf44544e23 Mon Sep 17 00:00:00 2001 From: hengyunabc Date: Fri, 11 Nov 2022 16:19:46 +0800 Subject: [PATCH] fix thread command NullPointerException. #2342 --- .../taobao/arthas/core/command/monitor200/ThreadCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/com/taobao/arthas/core/command/monitor200/ThreadCommand.java b/core/src/main/java/com/taobao/arthas/core/command/monitor200/ThreadCommand.java index 63e975174..4df8516ae 100755 --- a/core/src/main/java/com/taobao/arthas/core/command/monitor200/ThreadCommand.java +++ b/core/src/main/java/com/taobao/arthas/core/command/monitor200/ThreadCommand.java @@ -222,7 +222,7 @@ public class ThreadCommand extends AnnotatedCommand { private ThreadInfo findThreadInfoById(ThreadInfo[] threadInfos, long id) { for (int i = 0; i < threadInfos.length; i++) { ThreadInfo threadInfo = threadInfos[i]; - if ( threadInfo.getThreadId() == id) { + if (threadInfo != null && threadInfo.getThreadId() == id) { return threadInfo; } }