[jOOQ/jOOQ#11105] NullPointerException when GenerationTool is not properly initialised

This commit is contained in:
Lukas Eder 2020-12-08 15:19:03 +01:00
parent 5c41eea8e3
commit ddae3adfca

View File

@ -903,7 +903,9 @@ public class GenerationTool {
// Close connection only if it was created by the GenerationTool
if (connection != null) {
if (close) {
if (ctx.family() == HSQLDB && dataSource == null)
// [#11105] In case of misconfiguration, the ctx reference could be null as a side effect
if (ctx != null && ctx.family() == HSQLDB && dataSource == null)
ctx.execute("shutdown");
connection.close();