diff --git a/lib/src/query.c b/lib/src/query.c index 02933926..61991c2d 100644 --- a/lib/src/query.c +++ b/lib/src/query.c @@ -2978,9 +2978,7 @@ const TSQueryPredicateStep *ts_query_predicates_for_pattern( ) { Slice slice = self->patterns.contents[pattern_index].predicate_steps; *step_count = slice.length; - if (self->predicate_steps.contents == NULL) { - return NULL; - } + if (slice.length == 0) return NULL; return &self->predicate_steps.contents[slice.offset]; }