Skip to content

Commit

Permalink
Returns nil if index is not given
Browse files Browse the repository at this point in the history
  • Loading branch information
soutaro committed May 9, 2024
1 parent 703b982 commit 6c09194
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/rbs/inline/ast/comment_lines.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ def string
end

def comment_location(index)
return unless index

comments.each do |comment, offset|
comment_length = comment.location.length

Expand Down

0 comments on commit 6c09194

Please sign in to comment.