Skip to content

Commit 8337d2f

Browse files
authored
fix: NullPointerException when accessing arthas-output with MCP disabled (#3127)
1 parent b3f201d commit 8337d2f

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

core/src/main/java/com/taobao/arthas/core/shell/term/impl/http/HttpRequestHandler.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,13 @@ protected void channelRead0(ChannelHandlerContext ctx, FullHttpRequest request)
7676
}
7777

7878
//handle mcp request
79-
String mcpEndpoint = mcpRequestHandler.getMcpEndpoint();
80-
if (mcpEndpoint.equals(path)) {
81-
mcpRequestHandler.handle(ctx, request);
82-
isMcpHandled = true;
83-
return;
79+
if (mcpRequestHandler != null) {
80+
String mcpEndpoint = mcpRequestHandler.getMcpEndpoint();
81+
if (mcpEndpoint.equals(path)) {
82+
mcpRequestHandler.handle(ctx, request);
83+
isMcpHandled = true;
84+
return;
85+
}
8486
}
8587

8688
//handle webui requests

0 commit comments

Comments
 (0)