Fixed NPE happening with DEBUG logging.

This commit is contained in:
Simone Bordet 2016-12-01 18:19:05 +01:00
parent f2d8157b1e
commit a5861954b0
1 changed files with 2 additions and 0 deletions

View File

@ -456,6 +456,8 @@ public abstract class AbstractEndPoint extends IdleTimeout implements EndPoint
public String toConnectionString()
{
Connection connection = getConnection();
if (connection == null)
return "null";
if (connection instanceof AbstractConnection)
return ((AbstractConnection)connection).toConnectionString();
return String.format("%s@%x",connection.getClass().getSimpleName(),connection.hashCode());