File tree Expand file tree Collapse file tree 2 files changed +2
-1
lines changed
main/java/io/github/treesitter/jtreesitter
test/java/io/github/treesitter/jtreesitter Expand file tree Collapse file tree 2 files changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -313,7 +313,7 @@ public List<Node> getChildrenByFieldName(String name) {
313313 "Child index %s is out of bounds" .formatted (Integer .toUnsignedString (index )));
314314 }
315315 var segment = ts_node_field_name_for_child (self , index );
316- return segment == MemorySegment .NULL ? null : segment .getString (0 );
316+ return segment . equals ( MemorySegment .NULL ) ? null : segment .getString (0 );
317317 }
318318
319319 /**
Original file line number Diff line number Diff line change @@ -215,6 +215,7 @@ void getChildrenByFieldName() {
215215 @ Test
216216 void getFieldNameForChild () {
217217 var child = node .getChild (0 ).orElseThrow ();
218+ assertNull (child .getFieldNameForChild (0 ));
218219 assertEquals ("body" , child .getFieldNameForChild (2 ));
219220 }
220221
You can’t perform that action at this time.
0 commit comments