[ruby/rdoc] Early return when token_stream is nil

https://github.com/ruby/rdoc/commit/04f75d8516

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
This commit is contained in:
Toshimaru 2023-11-28 09:44:05 +09:00 committed by git
parent cda431f538
commit 56ccad060d

View File

@ -112,7 +112,7 @@ module RDoc::TokenStream
# 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