Skip to content
This repository has been archived by the owner on May 10, 2022. It is now read-only.

Commit

Permalink
fix: decompress will failed when the value is null (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
foreverneverer authored Sep 26, 2021
1 parent b31c506 commit 497f1b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public static byte[] tryDecompress(byte[] src) {
byte[] decompressedValue;
try {
decompressedValue = decompress(src);
} catch (PException e) {
} catch (Exception e) {
// decompress fail
decompressedValue = src;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,9 @@ public void testCompressionInterceptor() throws PException {
new String(commonTable.get(hashKey, sortKey, 10000)), new String(compressionValue));
Assertions.assertEquals(
new String(compressTable.get(hashKey, sortKey, 10000)), new String(compressionValue));

// if origin value is null, return null
byte[] ret = compressTable.get("not-exist".getBytes(), sortKey, 10000);
Assertions.assertNull(ret);
}
}

0 comments on commit 497f1b1

Please sign in to comment.