fix for wallhack spamming null pointer error

This commit is contained in:
noil 2019-11-20 22:27:31 -05:00
parent 4acfdcb46c
commit 85164b7a73
1 changed files with 5 additions and 1 deletions

View File

@ -136,7 +136,11 @@ public final class WallHackModule extends Module {
if (e instanceof EntityPlayer) { if (e instanceof EntityPlayer) {
final EntityPlayer player = (EntityPlayer) e; final EntityPlayer player = (EntityPlayer) e;
if (this.ping.getBoolean()) { if (this.ping.getBoolean()) {
final int responseTime = (int) MathUtil.clamp(mc.getConnection().getPlayerInfo(player.getUniqueID()).getResponseTime(), 0, 300); int responseTime = -1;
try {
responseTime = (int) MathUtil.clamp(mc.getConnection().getPlayerInfo(player.getUniqueID()).getResponseTime(), 0, 300);
} catch (NullPointerException np) {
}
pingFormatted = responseTime + "ms"; pingFormatted = responseTime + "ms";
float startX = -mc.fontRenderer.getStringWidth(pingFormatted) / 2.0f; float startX = -mc.fontRenderer.getStringWidth(pingFormatted) / 2.0f;