Skip to content

Commit 9285dba

Browse files
committed
Fixed [error] Type (::String | nil) does not have method length
``` lib/ruby_header_parser/parser.rb:357:29: [error] Type `(::String | nil)` does not have method `length` │ Diagnostic ID: Ruby::NoMethod │ └ ::Regexp.last_match(1).length ~~~~~~ ```
1 parent 8583271 commit 9285dba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/ruby_header_parser/parser.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ def prepare_argument_parts(parts:, arg_pos:)
354354
# @param type [String]
355355
def pointer_length(type)
356356
type =~ /(\*+)$/
357-
::Regexp.last_match(1).length
357+
::Regexp.last_match(1)&.length || 0
358358
end
359359
end
360360
end

0 commit comments

Comments
 (0)