
[Bug/Glitch] Crash when rendering username
Jab125 opened this issue ยท 1 comments
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()
.
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.