Skip to content

Commit

Permalink
Base#file might potentially return nil.
Browse files Browse the repository at this point in the history
  • Loading branch information
ksss committed Sep 12, 2023
1 parent 698b22c commit ca8f48f
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 ca8f48f

Please sign in to comment.