Skip to content

Commit 625e0d0

Browse files
ryanfox1985ctran
authored andcommitted
Fix bug, the max array can contains a nil values. (#432)
1 parent 866a23a commit 625e0d0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/annotate/annotate_routes.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,10 @@ def header(options = {})
4141
return out if routes_map.size.zero?
4242

4343
maxs = [HEADER_ROW.map(&:size)] + routes_map[1..-1].map { |line| line.split.map(&:size) }
44-
max = maxs.map(&:max).max
4544

4645
if options[:format_markdown]
46+
max = maxs.map(&:max).compact.max
47+
4748
out += ["# #{content(HEADER_ROW, maxs, options)}"]
4849
out += ["# #{content(['-' * max, '-' * max, '-' * max, '-' * max], maxs, options)}"]
4950
else

0 commit comments

Comments
 (0)