Guard against NPE when getting real IP
This commit is contained in:
parent
9b7d8d544e
commit
694dfbd313
@ -1,4 +1,4 @@
|
|||||||
From 7ba79caac4ca9b248fe29b48ef6852db5c19fd13 Mon Sep 17 00:00:00 2001
|
From 391c4be8c84b3e1220a84b4878b2be67b143d62a Mon Sep 17 00:00:00 2001
|
||||||
From: md_5 <md_5@live.com.au>
|
From: md_5 <md_5@live.com.au>
|
||||||
Date: Sat, 23 Mar 2013 11:15:11 +1100
|
Date: Sat, 23 Mar 2013 11:15:11 +1100
|
||||||
Subject: [PATCH] BungeeCord Support
|
Subject: [PATCH] BungeeCord Support
|
||||||
@ -79,7 +79,7 @@ index fed3181..a0c66d8 100644
|
|||||||
if (metrics == null) {
|
if (metrics == null) {
|
||||||
try {
|
try {
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
index 0b5ea21..fa9b9f1 100644
|
index 0b5ea21..26cb661 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
@@ -1012,4 +1012,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
@@ -1012,4 +1012,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||||
@ -89,7 +89,7 @@ index 0b5ea21..fa9b9f1 100644
|
|||||||
+
|
+
|
||||||
+ // Spigot start
|
+ // Spigot start
|
||||||
+ public InetSocketAddress getRawAddress() {
|
+ public InetSocketAddress getRawAddress() {
|
||||||
+ return (InetSocketAddress) this.getHandle().playerConnection.networkManager.getSocket().getRemoteSocketAddress();
|
+ return (getHandle().playerConnection == null) ? null : (InetSocketAddress) getHandle().playerConnection.networkManager.getSocket().getRemoteSocketAddress();
|
||||||
+ }
|
+ }
|
||||||
+ // Spigot end
|
+ // Spigot end
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user