GenericJMX: fix potential dereference after NPE
[collectd.git] / bindings / java / org / collectd / java / GenericJMXConfConnection.java
index aced54b..887c289 100644 (file)
@@ -137,7 +137,9 @@ class GenericJMXConfConnection
   {
     try
     {
-      this._jmx_connector.close();
+      if (this._jmx_connector != null) {
+        this._jmx_connector.close();
+      }
     }
     catch (Exception e)
     {