Skip to content

Commit

Permalink
Fix: don't throw an exception when sanitizing nil
Browse files Browse the repository at this point in the history
  • Loading branch information
nono committed Jun 25, 2013
1 parent 9fad0ce commit 6e2af2c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions lib/html/pipeline/linuxfr.rb
Expand Up @@ -22,9 +22,10 @@ def self.render(text)
result[:output].to_s
end

def self.sanitize(text)
pipeline = HTML::Pipeline.new [HTML::Pipeline::SanitizationFilter], CONTEXT
result = pipeline.call text
def self.sanitize(html)
return "" if html.nil?
pipeline = HTML::Pipeline.new [HTML::Pipeline::SanitizationFilter]
result = pipeline.call html
result[:output].to_s
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/html/pipeline/version.rb
@@ -1,5 +1,5 @@
module HTML
class Pipeline
VERSION = "0.14.2"
VERSION = "0.14.3"
end
end

0 comments on commit 6e2af2c

Please sign in to comment.