We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3739b77 commit 1245d54Copy full SHA for 1245d54
lib/src/node.c
@@ -571,6 +571,10 @@ TSNode ts_node_child_by_field_id(TSNode self, TSFieldId field_id) {
571
572
const char *ts_node_field_name_for_child(TSNode self, uint32_t child_index) {
573
const TSFieldMapEntry *field_map_start = NULL, *field_map_end = NULL;
574
+ if (!ts_node_child_count(self)) {
575
+ return NULL;
576
+ }
577
+
578
ts_language_field_map(
579
self.tree->language,
580
ts_node__subtree(self).ptr->production_id,
0 commit comments