From 0ddd3704fb3c540dafa9cb18f96238e1e99866e8 Mon Sep 17 00:00:00 2001 From: Bernd Eckenfels Date: Thu, 15 Sep 2022 16:53:48 +0200 Subject: [PATCH] SimpleDerbyTest: Avoid confusing cleanup NPE when DB start failed. --- .../vfs2/provider/jdbctable/test/SimpleDerbyTest.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vfs2provider-jdbctable/src/test/java/com/seeburger/vfs2/provider/jdbctable/test/SimpleDerbyTest.java b/vfs2provider-jdbctable/src/test/java/com/seeburger/vfs2/provider/jdbctable/test/SimpleDerbyTest.java index dc1ad13..71fb266 100644 --- a/vfs2provider-jdbctable/src/test/java/com/seeburger/vfs2/provider/jdbctable/test/SimpleDerbyTest.java +++ b/vfs2provider-jdbctable/src/test/java/com/seeburger/vfs2/provider/jdbctable/test/SimpleDerbyTest.java @@ -55,7 +55,10 @@ public static void destroyDatabase() { System.out.println("Tearing down database"); EmbeddedDataSource ds = (EmbeddedDataSource)dataSource; dataSource = null; - ds.setShutdownDatabase("true"); + if (ds != null) // avoid exception during init errors + { + ds.setShutdownDatabase("true"); + } } @Override