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

Commit 75baf85

Browse files
committed
fix: update exception thrown in TSQuery constructor
1 parent cd00365 commit 75baf85

File tree

1 file changed

+4
-1
lines changed
  • android-tree-sitter/src/main/java/com/itsaky/androidide/treesitter

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ public class TSQuery implements AutoCloseable {
4444
* is written to the `error_type` parameter.
4545
*/
4646
public TSQuery(TSLanguage language, String source) {
47-
Objects.requireNonNull(language, "Language cannot be null");
47+
if (language == null) {
48+
throw new IllegalArgumentException("Language cannot be null");
49+
}
50+
4851
if (source == null || source.isEmpty()) {
4952
throw new IllegalArgumentException("Query source cannot be null");
5053
}

0 commit comments

Comments
 (0)