added assignment to handle nil code values

This commit is contained in:
Zachary Patten 2011-06-01 12:33:08 -05:00
parent 97a971897f
commit 4c4ef24222

View File

@ -18,6 +18,7 @@ class Rocco::Layout < Mustache
def sections def sections
num = 0 num = 0
@doc.sections.map do |docs,code| @doc.sections.map do |docs,code|
code ||= ''
is_header = /^<h.>(.+)<\/h.>$/.match( docs ) is_header = /^<h.>(.+)<\/h.>$/.match( docs )
header_text = is_header && is_header[1].split.join("_") header_text = is_header && is_header[1].split.join("_")
num += 1 num += 1