Avoid dereferencing a null error structure

This commit is contained in:
Steve Singer 2012-04-23 22:00:31 -04:00
parent 27f601d1f0
commit 4b4f2326cc

View file

@ -135,11 +135,15 @@ public:
xmlError * error = xmlCtxtGetLastError( ctx_ );
std::ostringstream os;
os << "XML document not well formed";
int line=0;
std::string file;
if (error)
{
os << ": " << std::endl << error->message;
line = error->line;
file = error->file;
}
throw config_error(os.str(), error->line, error->file);
throw config_error(os.str(), line, file);
}
int iXIncludeReturn = xmlXIncludeProcessFlags(doc, options_);