lib/ox/document.rb in ox-1.8.3 vs lib/ox/document.rb in ox-1.8.4
- old
+ new
@@ -16,10 +16,10 @@
@attributes[:standalone] = prolog[:standalone] unless prolog[:standalone].nil?
end
# Returns the first Element in the document.
def root()
- unless @nodes.nil?
+ unless !instance_variable_defined?(:@nodes) || @nodes.nil?
@nodes.each do |n|
return n if n.is_a?(::Ox::Element)
end
end
nil