From: Ruben Kerkhof Date: Sat, 2 Apr 2016 15:00:34 +0000 (+0200) Subject: GenericJMX: fix potential dereference after NPE X-Git-Tag: collectd-5.6.0~364 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=8003c1333f686e953aa840c250e31d5c0e6e847f;p=collectd.git GenericJMX: fix potential dereference after NPE Fixes CID #41723 --- diff --git a/bindings/java/org/collectd/java/GenericJMXConfConnection.java b/bindings/java/org/collectd/java/GenericJMXConfConnection.java index aced54b4..887c2895 100644 --- a/bindings/java/org/collectd/java/GenericJMXConfConnection.java +++ b/bindings/java/org/collectd/java/GenericJMXConfConnection.java @@ -137,7 +137,9 @@ class GenericJMXConfConnection { try { - this._jmx_connector.close(); + if (this._jmx_connector != null) { + this._jmx_connector.close(); + } } catch (Exception e) {