Skip to content

Commit

Permalink
Bugfix: Recover from LinkageErrors if they happen when getting the By…
Browse files Browse the repository at this point in the history
…teString class.

This is part of #24
  • Loading branch information
nymanjens committed Nov 14, 2022
1 parent 481c9c4 commit 46c5758
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ static byte[] byteStringToByteArray(Object byteString) {
private static Optional<Class<?>> maybeGetByteStringClass() {
try {
return Optional.of(Class.forName("com.google.protobuf.ByteString"));
} catch (ClassNotFoundException unused) {
} catch (ClassNotFoundException | LinkageError unused) {
return Optional.absent();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ static byte[] byteStringToByteArray(Object byteString) {
private static Optional<Class<?>> maybeGetByteStringClass() {
try {
return Optional.of(Class.forName("com.google.protobuf.ByteString"));
} catch (ClassNotFoundException unused) {
} catch (ClassNotFoundException | LinkageError unused) {
return Optional.absent();
}
}
Expand Down

0 comments on commit 46c5758

Please sign in to comment.