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

Commit e09be82

Browse files
committed
fix: do not allow execution of invalid query in query cursor
1 parent b495e68 commit e09be82

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ public TSQueryCursor() {
3030

3131
/** Start running the given query on the given node. */
3232
public void exec(TSQuery query, TSNode node) {
33+
if (query == null || !query.isValid()) {
34+
throw new IllegalArgumentException("Cannot execute invalid query");
35+
}
3336
Native.exec(this.pointer, query.pointer, node);
3437
}
3538

0 commit comments

Comments
 (0)