Fix crash in ts_node_field_name_for_child when no children are present
This commit is contained in:
parent
3739b7794e
commit
1245d54fb8
1 changed files with 4 additions and 0 deletions
|
|
@ -571,6 +571,10 @@ recur:
|
|||
|
||||
const char *ts_node_field_name_for_child(TSNode self, uint32_t child_index) {
|
||||
const TSFieldMapEntry *field_map_start = NULL, *field_map_end = NULL;
|
||||
if (!ts_node_child_count(self)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ts_language_field_map(
|
||||
self.tree->language,
|
||||
ts_node__subtree(self).ptr->production_id,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue