aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-batch/src
diff options
context:
space:
mode:
authorDavid Gageot <david@gageot.net>2015-07-02 19:08:05 +0200
committerDavid Gageot <david@gageot.net>2015-07-02 19:30:06 +0200
commita03064e95f49b09e576432dc3547c50e7429eac6 (patch)
tree1610a82b4a1af039921ffa84932d48ab8701ed73 /sonar-batch/src
parenteacc42330748df1c39fc833067ad3e1ac9a9890c (diff)
downloadsonarqube-a03064e95f49b09e576432dc3547c50e7429eac6.tar.gz
sonarqube-a03064e95f49b09e576432dc3547c50e7429eac6.zip
Avoid additional NPE on test failure
Diffstat (limited to 'sonar-batch/src')
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/index/AbstractCachesTest.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/sonar-batch/src/test/java/org/sonar/batch/index/AbstractCachesTest.java b/sonar-batch/src/test/java/org/sonar/batch/index/AbstractCachesTest.java
index 08116780821..357259d7a18 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/index/AbstractCachesTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/index/AbstractCachesTest.java
@@ -47,13 +47,17 @@ public abstract class AbstractCachesTest {
@After
public void stop() {
- caches.stop();
- caches = null;
+ if (caches != null) {
+ caches.stop();
+ caches = null;
+ }
}
@AfterClass
public static void stopClass() {
- cachesManager.stop();
- cachesManager = null;
+ if (cachesManager != null) {
+ cachesManager.stop();
+ cachesManager = null;
+ }
}
}