Paper/nms-patches/ChatModifier.patch
2014-12-27 19:29:22 +00:00

31 lines
1.2 KiB
Diff

--- ../work/decompile-8eb82bde//net/minecraft/server/ChatModifier.java 2014-12-27 19:28:58.855157429 +0000
+++ src/main/java/net/minecraft/server/ChatModifier.java 2014-12-27 19:28:58.855157429 +0000
@@ -160,16 +160,18 @@
}
public int hashCode() {
- int i = this.b.hashCode();
+ // CraftBukkit start - fix npe
+ int i = b == null ? 0 : this.b.hashCode();
- i = 31 * i + this.c.hashCode();
- i = 31 * i + this.d.hashCode();
- i = 31 * i + this.e.hashCode();
- i = 31 * i + this.f.hashCode();
- i = 31 * i + this.g.hashCode();
- i = 31 * i + this.h.hashCode();
- i = 31 * i + this.i.hashCode();
- i = 31 * i + this.j.hashCode();
+ i = 31 * i + (c == null ? 0 : this.c.hashCode());
+ i = 31 * i + (d == null ? 0 : this.d.hashCode());
+ i = 31 * i + (e == null ? 0 : this.e.hashCode());
+ i = 31 * i + (f == null ? 0 : this.f.hashCode());
+ i = 31 * i + (g == null ? 0 : this.g.hashCode());
+ i = 31 * i + (h == null ? 0 : this.h.hashCode());
+ i = 31 * i + (this.i == null ? 0 : this.i.hashCode());
+ i = 31 * i + (j == null ? 0 : this.j.hashCode());
+ // CraftBukkit end
return i;
}