Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(YouTube): Check if
protobufBuffer
can be filtered
An `UnsupportedOperationException` exception would be thrown in `LithoFilterParameters#LithoFilterParameters` if this buffer is not backed by an accessible array
- Loading branch information
Showing
1 changed file
with
3 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -489,10 +489,11 @@ public static boolean filter(@Nullable String lithoIdentifier, @NonNull StringBu | |
return false; | ||
|
||
ByteBuffer protobufBuffer = bufferThreadLocal.get(); | ||
if (protobufBuffer == null) { | ||
LogHelper.printException(() -> "Proto buffer is null"); // Should never happen | ||
if (protobufBuffer == null || !protobufBuffer.hasArray()) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
oSumAtrIX
Author
Member
|
||
LogHelper.printException(() -> "Proto buffer is null or has no array"); // Should never happen. | ||
return false; | ||
} | ||
|
||
LithoFilterParameters parameter = new LithoFilterParameters(lithoIdentifier, pathBuilder, protobufBuffer); | ||
LogHelper.printDebug(() -> "Searching " + parameter); | ||
|
||
|
Can the protobuffer not have an array during normal app usage? This logs as an exception so it'll show a toast.