Permalink
Browse files

[BUGFIX] Inherit children which don't respond to #namespace

  • Loading branch information...
1 parent 54d5027 commit b9f2fa0b429a3f67c564750ef55ce6d34f767ea9 @benlangfeld committed Jul 6, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/niceogiri/xml/node.rb
@@ -137,7 +137,7 @@ def inherit(node)
inherit_attrs node.attributes
node.children.each do |c|
self << (n = c.dup)
- if c.namespace
+ if c.respond_to?(:namespace) && c.namespace
ns = n.add_namespace c.namespace.prefix, c.namespace.href
n.namespace = ns
end

0 comments on commit b9f2fa0

Please sign in to comment.