diff --git a/onvif/modules/lib/ONVIF/Deserializer/MessageParser.pm b/onvif/modules/lib/ONVIF/Deserializer/MessageParser.pm index b0ce6f0fd..0e4b6dcfb 100644 --- a/onvif/modules/lib/ONVIF/Deserializer/MessageParser.pm +++ b/onvif/modules/lib/ONVIF/Deserializer/MessageParser.pm @@ -272,7 +272,11 @@ sub _initialize { # $_method =~s{\.}{__}xg; $_method =~s{\-}{_}xg; - $list->[-1]->$_method( $current ); + if ( $list->[-1]->can( $_method ) ) { + $list->[-1]->$_method( $current ); + } else { + print ( "ERror " . $list->[-1] . " cannot $_method\n" ); + } $current = pop @$list; # step up in object hierarchy