File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -614,10 +614,18 @@ struct extended_model_description
614614 const auto xerces_cleanup = final_action ([]() {
615615 xercesc::XMLPlatformUtils::Terminate ();
616616 });
617+
617618 const auto domImpl = xercesc::DOMImplementationRegistry::getDOMImplementation (tc (" LS" ).get ());
618619 const auto parser = static_cast <xercesc::DOMImplementationLS*>(domImpl)->createLSParser (xercesc::DOMImplementationLS::MODE_SYNCHRONOUS, tc (" http://www.w3.org/2001/XMLSchema" ).get ());
620+
619621 const auto doc = parser->parseURI (ospModelDescription.string ().c_str ());
620- // TODO: Check return value for null
622+
623+ if (doc == nullptr ) {
624+ std::ostringstream oss;
625+ oss << " Validation of " << ospModelDescription.string () << " failed." ;
626+ BOOST_LOG_SEV (log::logger (), log::error) << oss.str ();
627+ throw std::runtime_error (oss.str ());
628+ }
621629
622630 const auto rootElement = doc->getDocumentElement ();
623631
You can’t perform that action at this time.
0 commit comments