Fixed NPE with @WithoutJenkins

This commit is contained in:
Kohsuke Kawaguchi committed 2013-06-20 14:21:13 -07:00
1 parent 2ffece9d73
commit bcce421513
1 file changed
+4 -2
@@ -381,8 +381,10 @@ public abstract class HudsonTestCase extends TestCase implements RootAction {
@Override
protected void tearDown() throws Exception {
try {
for (EndOfTestListener tl : jenkins.getExtensionList(EndOfTestListener.class))
tl.onTearDown();
if (jenkins!=null) {
for (EndOfTestListener tl : jenkins.getExtensionList(EndOfTestListener.class))
tl.onTearDown();
}
if (timeoutTimer!=null) {
timeoutTimer.cancel();