lib/niceogiri/xml/node.rb in niceogiri-1.1.1 vs lib/niceogiri/xml/node.rb in niceogiri-1.1.2
- old
+ new
@@ -150,10 +150,10 @@
#
# @param [Hash] attrs a hash of attributes to set on the node
# @return [self]
def inherit_attrs(attrs)
attrs.each do |name, value|
- attr_name = value.namespace ? [value.namespace.prefix, name].join(':') : name
+ attr_name = value.namespace && value.namespace.prefix ? [value.namespace.prefix, name].join(':') : name
self.write_attr attr_name, value
end
self
end