File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -493,13 +493,14 @@ fn collect_class_members(class_node: &Node, source: &[u8]) -> Vec<Definition> {
493493fn extract_property_name ( prop_node : & Node , source : & [ u8 ] ) -> Option < String > {
494494 let struct_decl = find_child ( prop_node, "struct_declaration" ) ?;
495495 for i in 0 ..struct_decl. child_count ( ) {
496- let child = struct_decl. child ( i) ?;
497- if child. kind ( ) == "struct_declarator" {
498- // struct_declarator > pointer_declarator > identifier
499- // or struct_declarator > identifier (no pointer)
500- let name = unwrap_property_declarator ( & child, source) ;
501- if !name. is_empty ( ) {
502- return Some ( name) ;
496+ if let Some ( child) = struct_decl. child ( i) {
497+ if child. kind ( ) == "struct_declarator" {
498+ // struct_declarator > pointer_declarator > identifier
499+ // or struct_declarator > identifier (no pointer)
500+ let name = unwrap_property_declarator ( & child, source) ;
501+ if !name. is_empty ( ) {
502+ return Some ( name) ;
503+ }
503504 }
504505 }
505506 }
You can’t perform that action at this time.
0 commit comments