Amend HBASE-14771 RpcServer#getRemoteAddress always returns null

This change has been reported to cause Phoenix's PhoenixIndexRpcSchedulerTest to fail
with a NPE
This commit is contained in:
Andrew Purtell 2016-01-15 17:32:43 -08:00
parent 2d2fdd5a9f
commit 79588240c6
1 changed files with 1 additions and 1 deletions

View File

@ -2603,7 +2603,7 @@ public class RpcServer implements RpcServerInterface, ConfigurationObserver {
*/
public static InetAddress getRemoteIp() {
Call call = CurCall.get();
if (call != null && call.connection.socket != null) {
if (call != null && call.connection != null && call.connection.socket != null) {
return call.connection.socket.getInetAddress();
}
return null;