Skip to content

Commit 1a0fb3b

Browse files
committed
Fix Java test fixture teardown order
1 parent 4d06bdd commit 1a0fb3b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/test/java/com/lbugdb/TestBase.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,12 @@ static void getDBandConn() throws IOException {
2626
@AfterAll
2727
static void destroyDBandConn() {
2828
try {
29-
db.close();
30-
conn.close();
29+
if (conn != null) {
30+
conn.close();
31+
}
32+
if (db != null) {
33+
db.close();
34+
}
3135
} catch (AssertionError e) {
3236
fail("destroyDBandConn failed: ");
3337
}

0 commit comments

Comments
 (0)