summaryrefslogtreecommitdiffstats
path: root/nms-patches/ChatModifier.patch
blob: b28629d23cf14bdb8ef3bd8040c7939b22a5ea64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
--- ../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;
     }