Skip to content

Commit 29d1cd3

Browse files
committed
Merge branch '2.1.x'
Closes gh-17124
2 parents 5e3c86a + c12ccfb commit 29d1cd3

File tree

1 file changed

+8
-2
lines changed
  • spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar

1 file changed

+8
-2
lines changed

spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFile.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,15 @@ private JarFile(RandomAccessDataFile rootFile, String pathFromRoot, RandomAccess
118118
this.pathFromRoot = pathFromRoot;
119119
CentralDirectoryParser parser = new CentralDirectoryParser();
120120
this.entries = parser.addVisitor(new JarFileEntries(this, filter));
121-
parser.addVisitor(centralDirectoryVisitor());
122-
this.data = parser.parse(data, filter == null);
123121
this.type = type;
122+
parser.addVisitor(centralDirectoryVisitor());
123+
try {
124+
this.data = parser.parse(data, filter == null);
125+
}
126+
catch (RuntimeException ex) {
127+
close();
128+
throw ex;
129+
}
124130
this.manifestSupplier = (manifestSupplier != null) ? manifestSupplier : () -> {
125131
try (InputStream inputStream = getInputStream(MANIFEST_NAME)) {
126132
if (inputStream == null) {

0 commit comments

Comments
 (0)