diff options
author | Toshimaru <[email protected]> | 2023-11-28 09:44:05 +0900 |
---|---|---|
committer | git <[email protected]> | 2023-12-05 06:21:52 +0000 |
commit | 56ccad060d1c215280f12444f726d54d2ca6636d (patch) | |
tree | bf05e0df1d7f5c0373533aea9ce9a2602e143211 /lib | |
parent | cda431f5388e8359532998c7fbf5fa615ce6d45e (diff) |
[ruby/rdoc] Early return when `token_stream` is `nil`
https://github.com/ruby/rdoc/commit/04f75d8516
Co-authored-by: Nobuyoshi Nakada <[email protected]>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rdoc/token_stream.rb | 2 |
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 |