mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-14 04:22:16 +00:00
Test: avoid NPE when zipFile could not be created
This commit is contained in:
1 parent
2de5e7618d
commit
9600a0aa0b
1 file changed
+12
-10
@@ -65,13 +65,13 @@ public class ZipArchiverTest extends TestCase {
|
||||
} catch (Exception e) {
|
||||
fail("exception driving ZipArchiver", e);
|
||||
} finally {
|
||||
try {
|
||||
archiver.close();
|
||||
} catch (IOException e) {
|
||||
// ignored
|
||||
if (archiver != null) {
|
||||
try {
|
||||
archiver.close();
|
||||
} catch (IOException e) {
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
|
||||
archiver = null;
|
||||
}
|
||||
|
||||
// examine zip contents and assert that none of the entry names (paths) have
|
||||
@@ -86,10 +86,12 @@ public class ZipArchiverTest extends TestCase {
|
||||
} catch (Exception e) {
|
||||
fail("failure enumerating zip entries", e);
|
||||
} finally {
|
||||
try {
|
||||
zipFileVerify.close();
|
||||
} catch (IOException e) {
|
||||
// ignored
|
||||
if (zipFileVerify != null) {
|
||||
try {
|
||||
zipFileVerify.close();
|
||||
} catch (IOException e) {
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user