From 5ff24b689125d61ce4ab2fe0af232ebfa4d8dd68 Mon Sep 17 00:00:00 2001 From: Vinoth Kannan Date: Fri, 1 May 2020 10:03:40 +0530 Subject: [PATCH] FIX: do not raise error if 'class' attribute is not found. --- lib/excerpt_parser.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/excerpt_parser.rb b/lib/excerpt_parser.rb index 4a2f483f36..054a123401 100644 --- a/lib/excerpt_parser.rb +++ b/lib/excerpt_parser.rb @@ -97,7 +97,7 @@ class ExcerptParser < Nokogiri::XML::SAX::Document when "aside" attributes = Hash[*attributes.flatten] - unless (@keep_onebox_source || @keep_onebox_body) && attributes['class'].include?('onebox') + unless (@keep_onebox_source || @keep_onebox_body) && attributes['class']&.include?('onebox') @in_quote = true end