summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToshimaru <me@toshimaru.net>2023-11-28 09:44:05 +0900
committergit <svn-admin@ruby-lang.org>2023-12-05 06:21:52 +0000
commit56ccad060d1c215280f12444f726d54d2ca6636d (patch)
treebf05e0df1d7f5c0373533aea9ce9a2602e143211
parentcda431f5388e8359532998c7fbf5fa615ce6d45e (diff)
[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>
-rw-r--r--lib/rdoc/token_stream.rb2
1 files changed, 1 insertions, 1 deletions
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