Skip to content

Commit 04f75d8

Browse files
toshimarunobu
authored andcommitted
Early return when token_stream is nil
Co-authored-by: Nobuyoshi Nakada <[email protected]>
1 parent d8c19d7 commit 04f75d8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/rdoc/token_stream.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def token_stream
112112
# Returns a string representation of the token stream
113113

114114
def tokens_to_s
115-
Array(token_stream).compact.map { |token| token[:text] }.join ''
115+
(token_stream or return '').compact.map { |token| token[:text] }.join ''
116116
end
117117

118118
end

0 commit comments

Comments
 (0)