From 94d4fab52a6645b5ed034af3a38826d86a46b7e9 Mon Sep 17 00:00:00 2001 From: tanyawen Date: Sun, 29 Dec 2019 09:30:26 +0800 Subject: [PATCH] fix: trackerServer connection param check --- src/main/java/org/csource/fastdfs/TrackerServer.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/org/csource/fastdfs/TrackerServer.java b/src/main/java/org/csource/fastdfs/TrackerServer.java index a497471..bcb5413 100644 --- a/src/main/java/org/csource/fastdfs/TrackerServer.java +++ b/src/main/java/org/csource/fastdfs/TrackerServer.java @@ -48,6 +48,9 @@ public class TrackerServer { return this.inetSockAddr; } public void close(Connection connection) throws IOException { + if (connection == null) { + return; + } //if connection enabled get from connection pool if (ClientGlobal.g_connection_pool_enabled) { ConnectionPool.closeConnection(connection); @@ -62,6 +65,9 @@ public class TrackerServer { * @throws IOException */ public void releaseConnection(Connection connection) throws IOException { + if (connection == null) { + return; + } if (ClientGlobal.g_connection_pool_enabled) { ConnectionPool.releaseConnection(connection); } else {