Commits

Shlomi Fish  committed e95c0b5

Add a patch for RT #75195.

  • Participants
  • Parent commits 977deb3

Comments (0)

Files changed (2)

 Revision history for Perl extension XML::LibXML
 
+
+    - Fix for test failure on perls < 5.10.
+        - Fixes https://rt.cpan.org/Public/Bug/Display.html?id=75195
+        - Thanks to Paul for the report, and for a patch that was not
+        accepted.
+
 1.91            Tue Feb 21 13:57:54 IST 2012
     - Overload hash dereferencing on XML::LibXML::Elements, to provide
     access to the element's attributes.

File lib/XML/LibXML/AttributeHash.pm

 sub all_keys
 {
     my ($self, @keys) = @_;
-    foreach ($self->element->attributes)
+
+    my $elem = $self->element;
+
+    foreach my $attr (defined($elem) ? $elem->attributes : ())
     {
-        if (! $_->isa('XML::LibXML::Namespace'))
+        if (! $attr->isa('XML::LibXML::Namespace'))
         {
-            push @keys, $self->to_clark($_->namespaceURI, $_->localname);
+            push @keys, $self->to_clark($attr->namespaceURI, $attr->localname);
         }
     }
+
     return sort @keys;
 }