Skip to content
This repository has been archived by the owner on Oct 26, 2024. It is now read-only.

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
LisoUseInAIKyrios committed Feb 7, 2024
1 parent 874600f commit 2a84dae
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -523,10 +523,12 @@ public static boolean filter(@Nullable String lithoIdentifier, @NonNull StringBu

ByteBuffer protobufBuffer = bufferThreadLocal.get();
final byte[] bufferArray;
// The buffer can be null or empty when using YT 19.x.
// This is likely caused by different threads setting the buffer and calling this method.
// 100% fixing this would require passing the buffer into this method (which may not be so simple).
// For now, still filter with an empty buffer so the non proto buffer filters work correctly.
if (protobufBuffer == null) {
// The buffer can be null or empty in some situations.
// Still attempt to filter on the id/path with an empty buffer.
Logger.printDebug(() -> "Proto buffer is null"); // Can remove this log statement if it occurs too often.
Logger.printDebug(() -> "Proto buffer is null");
bufferArray = EMPTY_BYTE_ARRAY;
} else if (!protobufBuffer.hasArray()) {
Logger.printDebug(() -> "Proto buffer does not have an array");
Expand Down

0 comments on commit 2a84dae

Please sign in to comment.