SwedbankPay / kramdown-plantuml

PlantUML support for Kramdown, the Markdown parser used in Jekyll
https://rubygems.org/gems/kramdown-plantuml
Apache License 2.0
8 stars 2 forks source link

DX-914: Add nil guard #72

Closed asbjornu closed 2 years ago

asbjornu commented 2 years ago

Add guard for when page.output is nil, empty or not a String such as this:

NoMethodError:
       undefined method `gsub' for nil:NilClass
     # ./vendor/bundle/ruby/2.7.0/gems/kramdown-plantuml-1.1.6/lib/kramdown-plantuml/jekyll_provider.rb:60:in `replace_needles'
     # ./vendor/bundle/ruby/2.7.0/gems/kramdown-plantuml-1.1.6/lib/kramdown-plantuml/jekyll_provider.rb:29:in `block (2 levels) in install'
     # ./vendor/bundle/ruby/2.7.0/gems/kramdown-plantuml-1.1.6/lib/kramdown-plantuml/jekyll_provider.rb:28:in `each'
     # ./vendor/bundle/ruby/2.7.0/gems/kramdown-plantuml-1.1.6/lib/kramdown-plantuml/jekyll_provider.rb:28:in `block in install'
     # ./vendor/bundle/ruby/2.7.0/gems/jekyll-4.2.1/lib/jekyll/hooks.rb:103:in `block in trigger'
     # ./vendor/bundle/ruby/2.7.0/gems/jekyll-4.2.1/lib/jekyll/hooks.rb:102:in `each'
     # ./vendor/bundle/ruby/2.7.0/gems/jekyll-4.2.1/lib/jekyll/hooks.rb:102:in `trigger'
     # ./vendor/bundle/ruby/2.7.0/gems/jekyll-4.2.1/lib/jekyll/site.rb:213:in `render'
     # ./vendor/bundle/ruby/2.7.0/gems/jekyll-4.2.1/lib/jekyll/site.rb:80:in `process'
     # ./vendor/bundle/ruby/2.7.0/gems/jekyll-4.2.1/lib/jekyll/command.rb:28:in `process_site'
     # ./vendor/bundle/ruby/2.7.0/gems/jekyll-4.2.1/lib/jekyll/commands/build.rb:65:in `build'
     # ./vendor/bundle/ruby/2.7.0/gems/jekyll-4.2.1/lib/jekyll/commands/build.rb:36:in `process'
     # ./lib/commands/jekyll_builder.rb:18:in `execute'
     # ./lib/commands/jekyll_server.rb:17:in `execute'
     # ./spec/jekyll_server_spec.rb:30:in `block (4 levels) in <top (required)>'
codecov[bot] commented 2 years ago

Codecov Report

Merging #72 (a6374e9) into main (4b0fff3) will increase coverage by 0.00%. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main      #72   +/-   ##
=======================================
  Coverage   96.61%   96.62%           
=======================================
  Files          12       12           
  Lines         384      385    +1     
=======================================
+ Hits          371      372    +1     
  Misses         13       13           
Impacted Files Coverage Δ
lib/kramdown-plantuml/jekyll_provider.rb 87.03% <100.00%> (+0.24%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 4b0fff3...a6374e9. Read the comment docs.

mergify[bot] commented 2 years ago

Thank you @asbjornu for your contribution!