Skip to content

fix(ui): guard server ping loop against netty NPE crash (#179) - #180

Merged
gaoyu06 merged 1 commit into
mainfrom
fix/multiplayer-ping-crash-179
Aug 8, 2026
Merged

fix(ui): guard server ping loop against netty NPE crash (#179)#180
gaoyu06 merged 1 commit into
mainfrom
fix/multiplayer-ping-crash-179

Conversation

@gaoyu06

@gaoyu06 gaoyu06 commented Aug 8, 2026

Copy link
Copy Markdown
Member

问题

Issue #179:进入多人游戏服务器列表页面后客户端崩溃(Ticking screen / NullPointerException)。

根因

vanilla OldServerPinger 的旧版-ping 回退路径在服务器地址解析失败时,会把 null 地址传给 netty Bootstrap.connectcheckAddress 抛 NPE。该异常在 GuiMultiplayer.updateScreen → pingPendingNetworks() 的 tick 线程上冒泡,导致整个客户端硬崩(典型触发:ViaForge + 一个不可达的服务器条目)。

修复

pingPendingNetworks() 包一层 try/catch(Throwable),单个服务器 ping 出错只记日志、不再崩掉整个界面。另一处初始 ping()ServerListEntry)本就在后台线程且已被 try/catch 保护,无需改动。

Closes #179

🤖 Generated with Claude Code

OldServerPinger's legacy-ping fallback can pass a null remote address to
netty Bootstrap.connect (checkAddress NPE) when a server entry fails to
resolve. Running on the tick thread inside GuiMultiplayer.updateScreen,
that NPE bubbled up as a "Ticking screen" ReportedException and hard-
crashed the client (typically with ViaForge + an unreachable server).

Wrap pingPendingNetworks() in a try/catch so a single bad server ping is
logged instead of taking down the whole screen.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gaoyu06
gaoyu06 merged commit bf69102 into main Aug 8, 2026
1 check passed
@gaoyu06
gaoyu06 deleted the fix/multiplayer-ping-crash-179 branch August 8, 2026 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

在服务器Ping页面崩溃

1 participant