mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +00:00
Fix NullReferenceException in StartConsoleSession when running with BasicIO
In headless/BasicIO mode, ConsoleIO.Backend remains null because ClassicConsoleBackend is never initialized. StartConsoleSession() must guard against a null backend to avoid crashing right after a successful server join. Without this fix, BasicIO mode (used for unattended / batch automation with CREATE_NO_WINDOW) crashes with: NullReferenceException: Object reference not set to an instance of an object. at MinecraftClient.McClient.StartConsoleSession() The fix adds an early return when ConsoleIO.Backend is null, which is safe because BasicIO mode does not need interactive console input handling at all. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
b13511f201
commit
1bc57399c8
1 changed files with 3 additions and 0 deletions
|
|
@ -525,6 +525,9 @@ namespace MinecraftClient
|
|||
|
||||
private void StartConsoleSession()
|
||||
{
|
||||
if (ConsoleIO.Backend is null)
|
||||
return;
|
||||
|
||||
cmdprompt = new CancellationTokenSource();
|
||||
|
||||
if (!consoleReadThreadOwned)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue