Skip to content

Commit 6a50149

Browse files
committed
Handle a missing description gracefully
b5da040 introduced word_wrap which assumes text is a string. However, this is not true and not every resource type has a description.
1 parent a76dd4c commit 6a50149

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/puppet-strings/markdown/base.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ def private?
170170
end
171171

172172
def word_wrap(text, line_width: 120, break_sequence: "\n")
173+
return unless text
173174
text.split("\n").collect! do |line|
174175
line.length > line_width ? line.gsub(/(.{1,#{line_width}})(\s+|$)/, "\\1#{break_sequence}").strip : line
175176
end * break_sequence

0 commit comments

Comments
 (0)