From ab2ee83812fd13988b8f3f881abbb1cbc94dc009 Mon Sep 17 00:00:00 2001 From: Costantino Perciante Date: Sat, 9 Jul 2016 20:32:56 +0000 Subject: [PATCH] minor check added git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/social-networking/social-data-search-client@130209 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../social_data_search_client/ElasticSearchClientImpl.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/gcube/socialnetworking/social_data_search_client/ElasticSearchClientImpl.java b/src/main/java/org/gcube/socialnetworking/social_data_search_client/ElasticSearchClientImpl.java index 6126d93..d65c06e 100644 --- a/src/main/java/org/gcube/socialnetworking/social_data_search_client/ElasticSearchClientImpl.java +++ b/src/main/java/org/gcube/socialnetworking/social_data_search_client/ElasticSearchClientImpl.java @@ -181,12 +181,13 @@ public class ElasticSearchClientImpl implements ElasticSearchClientInterface{ return response.isFound(); } - + @Override protected void finalize() throws Throwable { super.finalize(); _log.info("Called finalize.. closing connection to elasticsearch"); - client.close(); + if(client != null) + client.close(); } - + }