trulia / hologram

A markdown based documentation system for style guides.
http://trulia.github.io/hologram
Other
2.16k stars 199 forks source link

Fix nil.map call in link_helper #185

Closed jdcantrell closed 9 years ago

jdcantrell commented 9 years ago

@gpleiss I'm seeing:

/home/jd/.gem/ruby/bundler/gems/hologram-bcd45252c628/lib/hologram/doc_builder.rb:190:
in `block in link_helper': undefined method `map' for nil:NilClass (NoMethodError)

When building our current style guide with the latest hologram master. Does this seem like an appropriate fix? I've not spent enough time working out why :blocks is empty in the spot, but it seems like for Trulia's use case it is happening.

jdcantrell commented 9 years ago

:blocks can be nil while using an erb template in hologram. It creates a stub page but since it's a generated template we do not have any block info. Given that I believe this fix is correct, I'm going to merge it but please comment if there's something I'm missing.

gpleiss commented 9 years ago

Sorry, did not notice this till just now! Thanks for the patch - I forgot to check the nil case :grin: