Legacy4J

Legacy4J

209k Downloads

[Bug/Glitch] Crash when rendering username

Jab125 opened this issue ยท 1 comments

commented

Legacy4J Version

1.21-0.7.4

Mod Loader Version

Fabric Loader 0.16.5

Bug/Glitch Occurrence Context

When signing in and entering the encryption password

Crash Report

https://gist.github.com/Jab125/66c820b9e7b1441f3ffd12ec01758c5f

What happened wrong?

Game crash

Code Analysis

mc.getUser() can in fact be null, which would cause a game crash when trying to call getUsername().

String username = MCAccount.isOfflineUser() ? I18n.get("legacy.menu.offline_user",mc.getUser().getName()) : mc.getUser().getName();

Potential Solution

Right above the problematic line, add:

if (mc.getUser() == null) return;

so if mc.getUser() ends up being null, simply not rendering the username at all.

commented

Fixed in 1.7.5.2444.0, thanks for reporting.