Skip to content

Commit 620c84d

Browse files
committed
Fix error message not propagating in decompressors
1 parent 4deff93 commit 620c84d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/main/java/software/coley/lljzip/format/compression/DeflateDecompressor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public ByteData decompress(LocalFileHeader header, ByteData data) throws IOExcep
5050
} while (!inflater.finished());
5151
} catch (DataFormatException e) {
5252
String s = e.getMessage();
53-
throw (ZipException) new ZipException(s != null ? null : "Invalid ZLIB data format").initCause(e);
53+
throw (ZipException) new ZipException(s != null ? s : "Invalid ZLIB data format").initCause(e);
5454
} finally {
5555
inflater.end();
5656
}

src/main/java/software/coley/lljzip/format/compression/UnsafeDeflateDecompressor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public ByteData decompress(LocalFileHeader header, ByteData data) throws IOExcep
9090
} while (true);
9191
} catch (DataFormatException e) {
9292
String s = e.getMessage();
93-
throw (ZipException) new ZipException(s != null ? null : "Invalid ZLIB data format").initCause(e);
93+
throw (ZipException) new ZipException(s != null ? s : "Invalid ZLIB data format").initCause(e);
9494
} finally {
9595
end:
9696
{

0 commit comments

Comments
 (0)