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

Commit fb827ce

Browse files
committed
fix: IOOB exception when arg count is invalid in SetDirectiveHandler
1 parent 92c1b11 commit fb827ce

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

android-tree-sitter/src/main/java/com/itsaky/androidide/treesitter/predicate/SetDirectiveHandler.java

+4
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ public String[] getSupportedPredicates() {
5454
@Override
5555
public Result handle(TSQuery query, TSQueryMatch match, List<PredicateStep> args
5656
) {
57+
if (args.size() < PARAMETERS_1.length || args.size() > PARAMETERS_2.length) {
58+
return Result.UNHANDLED;
59+
}
60+
5761
if (!DIRECTIVE.equals(args.get(0).value)) {
5862
return Result.UNHANDLED;
5963
}

0 commit comments

Comments
 (0)