Skip to content

Fix crash after the game reaches the menu (null versionInfo) - #7

Merged
ChimeraAnt-DEV merged 1 commit into
mainfrom
fix/version-info-crash-after-menu
Sep 18, 2026
Merged

ChimeraAnt-DEV merged 1 commit into
mainfrom
fix/version-info-crash-after-menu

Conversation

@ChimeraAnt-DEV

@ChimeraAnt-DEV ChimeraAnt-DEV commented Sep 18, 2026 •

Copy link
Copy Markdown
Owner

What this fixes

The launcher shows its crash screen after the game reaches the menu. That screen is
ErrorActivity, reached either from the JVM exit callback or from the app's uncaught
exception handler — so something really is dying, not just failing to render.

Version.getVersionInfo() returns VersionInfo?. It is null whenever the version's
<name>.json is missing or fails to parse, while the version directory itself still exists
on disk. Three call sites dereferenced it with !!:

Site When it runs
LauncherElements.TryLaunch reads minecraftVersion before doing anything else
GameHandler.execute (pre-1.13 key fixups) as the game screen opens
GameHandler.execute (loadLanguage) as the game screen opens

The GameHandler ones fire as the game screen is being set up, which matches the reported
timing: the game gets far enough to look like it is starting, then dies.

The fix

All three now degrade instead of throwing.

  • The launch path checks versionInfo up front and emits a new
    LaunchGameOperation.InvalidVersion, which sends the user to version management with an
    explanation. Previously this was an unhandled NPE.
  • GameHandler skips the two version-dependent fixups when the version number is unknown.
    Neither is needed to start the game: one is a pre-1.13 keybind workaround, the other picks
    a language file.

The new string is added to values/, values-zh-rCN/, and values-zh-rTW/.

Also included

AGENTS.md — build notes, the launch pipeline layout, and the getVersionInfo() null
semantics so this class of bug is easier to avoid next time.

Verification

I could not compile or run this: the dev container has no JDK and no Android SDK
(java is not installed), and there is no attached device. The changes were verified by
reading: LaunchGameOperation is a sealed interface whose when in LauncherElements.kt
is exhaustive, so the new case had to be handled and is; no remaining getVersionInfo()!!
exists in the launch or game-screen paths.

Please build and run this against the version that was crashing to confirm.

Scope note

This is a null-safety fix for a real crash, and it is separate from the earlier
cracked/offline-account work. If your crash happens with a version whose JSON is intact,
this will not be the cause, and I would need the crash log from ErrorActivity to go
further.


By ChimeraTeam

getVersionInfo() returns null whenever a version's <name>.json is absent or
fails to parse, but the version directory itself still exists on disk. Three
call sites dereferenced it with !!:

- LauncherElements.TryLaunch read minecraftVersion before doing anything else.
- GameHandler.execute read it twice: once for the pre-1.13 key fixups and once
  for loadLanguage(). This one runs as the game screen opens, which is why the
  crash shows up after the game has already started loading.

All three now degrade instead of throwing. The launch path checks versionInfo
up front and reports a new LaunchGameOperation.InvalidVersion, which sends the
user to version management with an explanation rather than a crash screen; the
handler skips the two version-dependent fixups when the version number is
unknown. Neither fixup is needed to start the game.

Also add AGENTS.md with build notes and the launch pipeline layout.

Co-authored-by: openhands <openhands@all-hands.dev>
@ChimeraAnt-DEV
ChimeraAnt-DEV marked this pull request as ready for review September 18, 2026 20:14
@ChimeraAnt-DEV
ChimeraAnt-DEV merged commit 2cf55fe into main Sep 18, 2026
1 check passed
@ChimeraAnt-DEV
ChimeraAnt-DEV deleted the fix/version-info-crash-after-menu branch September 18, 2026 20:14
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.

2 participants