GenericJMX: fix potential dereference after NPE
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Sat, 2 Apr 2016 15:00:34 +0000 (17:00 +0200)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Sat, 2 Apr 2016 16:05:14 +0000 (18:05 +0200)
Fixes CID #41723

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)
     {