Skip to content

Commit

Permalink
added test to prohibit traverse_from_match from attempting to travers…
Browse files Browse the repository at this point in the history
…e nil children
  • Loading branch information
sutch committed Apr 20, 2009
1 parent 22b46aa commit c97595d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/scrubyt/utils/shared_utils.rb
Expand Up @@ -39,7 +39,7 @@ def match_data
results << node
results.delete node.parent if node.is_a? Hpricot::Elem
end
node.children.each { |child| traverse_for_match_inner.call(child, regexp) if (child.is_a? Hpricot::Elem) }
node.children.each { |child| traverse_for_match_inner.call(child, regexp) if (child.is_a? Hpricot::Elem) } if ! node.children.nil?
}
traverse_for_match_inner.call(node,regexp)
results
Expand Down

0 comments on commit c97595d

Please sign in to comment.