Subject: | Check definedness of $sibling |
Hi,
when comparing 2 XML files I got following error:
Can't call method "toString" on an undefined value at
/home/polus/modules/lib/perl5/site_perl/5.8.8/XML/Diff.pm line 1601.
Checking the definedness of $sibling before calling _debug() did the trick.
--- /home/polus/modules/lib/perl5/site_perl/5.8.8/XML/Diff.pm.old
2008-02-27 10:18:44.000000000 +0100
+++ /home/polus/modules/lib/perl5/site_perl/5.8.8/XML/Diff.pm
2008-02-27 10:20:03.000000000 +0100
@@ -1598,8 +1598,8 @@
}
} else {
($sibling) = $self->{old}->{root}->findnodes( $follows );
- $self->_debug( "sibling: ".$sibling->toString(1) );
return undef unless( defined $sibling );
+ $self->_debug( "sibling: ".$sibling->toString(1) );
if( $skip ) {
for(my$i=0;$i<$skip;$i++) {
$self->_debug( '..skipping node' );
Regards,
Bernhard