Skip to content

Commit

Permalink
Merge pull request #1506 from ksss/base-file-doc
Browse files Browse the repository at this point in the history
Base#file might potentially return `nil`.
  • Loading branch information
lsegal authored Sep 17, 2023
2 parents 698b22c + ca8f48f commit 852a772
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/yard/code_objects/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ def add_file(file, line = nil, has_comments = false)
# definitions with docstrings first.
#
# @return [String] a filename
# @return [nil] if there is no file associated with the object
def file
@files.first ? @files.first[0] : nil
end
Expand Down

0 comments on commit 852a772

Please sign in to comment.