Fix NullPointerException when accessing arthas-output with MCP disabled#3127
Merged
hengyunabc merged 2 commits intomasterfrom Jan 8, 2026
Merged
Fix NullPointerException when accessing arthas-output with MCP disabled#3127hengyunabc merged 2 commits intomasterfrom
hengyunabc merged 2 commits intomasterfrom
Conversation
|
|
Add null check for mcpRequestHandler before accessing getMcpEndpoint() method. This prevents NullPointerException when arthas.mcpEndpoint is set to empty string (MCP disabled) and accessing endpoints like /arthas-output/. Co-authored-by: hengyunabc <1683936+hengyunabc@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix unable to access arthas-output endpoint when mcp is disabled
Fix NullPointerException when accessing arthas-output with MCP disabled
Jan 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When
arthas.mcpEndpointis set to empty string (MCP disabled), accessing/arthas-output/throwsNullPointerExceptionat line 79 ofHttpRequestHandler.java. The code callsmcpRequestHandler.getMcpEndpoint()without checking ifmcpRequestHandleris null.Changes
mcpRequestHandlerbefore accessing MCP endpointThis aligns with
ArthasBootstrapbehavior wheremcpRequestHandleris only initialized when MCP endpoint is configured (line 479) and explicitly set to null on shutdown (line 538).Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.