diff options
author | toshimaru <[email protected]> | 2023-11-16 09:18:08 +0900 |
---|---|---|
committer | git <[email protected]> | 2023-11-16 01:43:12 +0000 |
commit | 72242e69aa7ad1e8ec9c5d7533c3bfd22a16d239 (patch) | |
tree | ef321e72931fb7a4eb22c6f01af78b43150eac1e /lib/rdoc/token_stream.rb | |
parent | d2e7a70ee6865a92992d4d793cd08a2805d2658a (diff) |
[ruby/rdoc] fix: Fix NoMethodError for `tokens_to_s` method
Calling `tokens_to_s` gets an error if `token_stream` is nil:
```
undefined method `compact' for nil:NilClass (NoMethodError)
```
So, fall back to an empty array if `@token_stream` is nil.
https://github.com/ruby/rdoc/commit/452e4a2600
Diffstat (limited to 'lib/rdoc/token_stream.rb')
-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 8fc6eadd85..1ff4b0d09e 100644 --- a/lib/rdoc/token_stream.rb +++ b/lib/rdoc/token_stream.rb @@ -105,7 +105,7 @@ module RDoc::TokenStream # Current token stream def token_stream - @token_stream + @token_stream || [] end ## |