Skip to content
Snippets Groups Projects
Commit 9e943022 authored by Vincent Massol's avatar Vincent Massol
Browse files

[Misc] Avoid NPE which can now happen after the fix for (XWIKI-10976: XE...

[Misc] Avoid NPE which can now happen after the fix for (XWIKI-10976: XE doesn't stop if there's a failure during the PersistentTestContext initialization)
parent b452cef4
No related branches found
No related tags found
No related merge requests found
...@@ -94,10 +94,12 @@ private void initializePersistentTestContext() ...@@ -94,10 +94,12 @@ private void initializePersistentTestContext()
@Override @Override
protected void afterTests() protected void afterTests()
{ {
try { if (context != null) {
context.shutdown(); try {
} catch (Exception e) { context.shutdown();
throw new RuntimeException("Failed to shutdown PersistentTestContext", e); } catch (Exception e) {
throw new RuntimeException("Failed to shutdown PersistentTestContext", e);
}
} }
// Note: Don't call super.afterTests() since XWiki will be stopped twice otherwise! // Note: Don't call super.afterTests() since XWiki will be stopped twice otherwise!
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment