Commit c692740b authored by Guillaume Surrel's avatar Guillaume Surrel
Browse files

Fix possible NPE.

parent 9305cd89
......@@ -144,25 +144,33 @@ public class JMSModule implements ExceptionListener {
logger.log(BasicLevel.DEBUG, "close()");
}
try {
cnx.setExceptionListener(null);
} catch (JMSException exc1) {
logger.log(BasicLevel.ERROR, "", exc1);
if (cnx != null) {
try {
cnx.setExceptionListener(null);
} catch (JMSException exc1) {
logger.log(BasicLevel.ERROR, "", exc1);
}
}
try {
cnx.stop();
} catch (JMSException exc) {
if (cnx != null) {
try {
cnx.stop();
} catch (JMSException exc) {
}
}
try {
reconnectionDaemon.stop();
} catch (Exception exc) {
if (reconnectionDaemon != null) {
try {
reconnectionDaemon.stop();
} catch (Exception exc) {
}
}
try {
cnx.close();
} catch (JMSException exc) {
if (cnx != null) {
try {
cnx.close();
} catch (JMSException exc) {
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment