File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
pluginlib/include/pluginlib Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -650,16 +650,23 @@ void ClassLoader<T>::processSingleXMLPluginFile(
650650 " ' has no Root Element. This likely means the XML is malformed or missing." );
651651 return ;
652652 }
653- if (!(strcmp (config->Value (), " library" ) == 0 ||
654- strcmp (config->Value (), " class_libraries" ) == 0 ))
653+ const char * config_value = config->Value ();
654+ if (NULL == config_value) {
655+ throw pluginlib::InvalidXMLException (
656+ " XML Document '" + xml_file +
657+ " ' has an invalid Root Element. This likely means the XML is malformed or missing." );
658+ return ;
659+ }
660+ if (!(strcmp (config_value, " library" ) == 0 ||
661+ strcmp (config_value, " class_libraries" ) == 0 ))
655662 {
656663 throw pluginlib::InvalidXMLException (
657664 " The XML document '" + xml_file + " ' given to add must have either \" library\" or "
658665 " \" class_libraries\" as the root tag" );
659666 return ;
660667 }
661668 // Step into the filter list if necessary
662- if (strcmp (config-> Value () , " class_libraries" ) == 0 ) {
669+ if (strcmp (config_value , " class_libraries" ) == 0 ) {
663670 config = config->FirstChildElement (" library" );
664671 }
665672
You can’t perform that action at this time.
0 commit comments