From 56ccad060d1c215280f12444f726d54d2ca6636d Mon Sep 17 00:00:00 2001 From: Toshimaru Date: Tue, 28 Nov 2023 09:44:05 +0900 Subject: [PATCH] [ruby/rdoc] Early return when `token_stream` is `nil` https://github.com/ruby/rdoc/commit/04f75d8516 Co-authored-by: Nobuyoshi Nakada --- lib/rdoc/token_stream.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rdoc/token_stream.rb b/lib/rdoc/token_stream.rb index ea8d9417cc..19ca7ed248 100644 --- a/lib/rdoc/token_stream.rb +++ b/lib/rdoc/token_stream.rb @@ -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