fix(lib): return early for empty predicate step slice
(cherry picked from commit 31b9717ca3)
This commit is contained in:
parent
69723ca40e
commit
b0a6bde2fb
1 changed files with 1 additions and 3 deletions
|
|
@ -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];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue