Handle null messages in connect error messages

This commit is contained in:
RaphiMC 2023-12-02 03:40:20 +01:00
parent 8a8f6a4659
commit 32917bb10f
No known key found for this signature in database
GPG Key ID: 0F6BB0657A03AC94

View File

@ -80,6 +80,11 @@ public abstract class MixinConnectScreen_1 {
return future;
}
@WrapOperation(method = "run", at = @At(value = "INVOKE", target = "Ljava/lang/Exception;getMessage()Ljava/lang/String;", remap = false))
private String handleNullExceptionMessage(Exception instance, Operation<String> original) {
return instance.getMessage() == null ? "" : original.call(instance);
}
@Redirect(method = "run", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/session/Session;getUsername()Ljava/lang/String;"))
private String useClassiCubeUsername(Session instance) {
if (this.viaFabricPlus$useClassiCubeAccount) {