WW-4923 Null check to avoid NPE when not passing a JDBC connection to the jasper report

This commit is contained in:
Paul Zepernick
2018-02-22 10:13:14 -05:00
parent 02c347afd4
commit 8bf6605e6b
@@ -384,7 +384,10 @@ public class JasperReportsResult extends StrutsResultSupport implements JasperRe
throw new ServletException(e.getMessage(), e);
} finally {
try {
conn.close();
if(conn != null) {
// avoid NPE if connection was not used for the report
conn.close();
}
} catch (Exception e) {
LOG.warn("Could not close db connection properly", e);
}