Skip to content

Error with unchecked object in init_callbacks() method #283

Description

@michal-josef-spacek

There is code:

sub input_callbacks {
    my $self     = shift;
    my $icbclass = shift;

    if ( defined $icbclass ) {
        $self->{XML_LIBXML_CALLBACK_STACK} = $icbclass;
    }
    return $self->{XML_LIBXML_CALLBACK_STACK};
}

and

sub _init_callbacks {
    my $self = shift;
    my $icb = $self->{XML_LIBXML_CALLBACK_STACK};
    unless ( defined $icb ) {
        $self->{XML_LIBXML_CALLBACK_STACK} = XML::LibXML::InputCallback->new();
        $icb = $self->{XML_LIBXML_CALLBACK_STACK};
    }

    $icb->init_callbacks($self);
}

Which don't control what goes in.

There are weird errors like:

# Can't locate object method "init_callbacks" via package "XML::LibXML::InputCallback=HASH(0x56364e82f280)" (perhaps you forgot to load "XML::LibXML::InputCallback=HASH(0x56364e82f280)"?) at /usr/lib64/perl5/vendor_perl/XML/LibXML.pm line 744.

(from customer)

I think the best way is create check before $icb->init_callbacks($self);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions