Skip to content

Commit

Permalink
Early return when token_stream is nil
Browse files Browse the repository at this point in the history
Co-authored-by: Nobuyoshi Nakada <[email protected]>
  • Loading branch information
2 people authored and hsbt committed Dec 5, 2023
1 parent d8c19d7 commit 04f75d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rdoc/token_stream.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def token_stream
# Returns a string representation of the token stream

def tokens_to_s
Array(token_stream).compact.map { |token| token[:text] }.join ''
(token_stream or return '').compact.map { |token| token[:text] }.join ''
end

end

0 comments on commit 04f75d8

Please sign in to comment.