When logging XML error messages, make sure we don't accidentally log an empty message
Amends my previous commit #a7508a9c from 23rd July 2015. If the filename and/or line number were NULL, we could end up logging a message with no text!
This commit is contained in:
parent
238cec8549
commit
fba9dc8c05
|
@ -226,14 +226,19 @@ libxml_structured_error_func (void* /* parsing_context*/,
|
|||
|
||||
replace_all (msg, "\n", "");
|
||||
|
||||
if (err->file && err->line) {
|
||||
error << X_("XML error: ") << msg << " in " << err->file << " at line " << err->line;
|
||||
if (!msg.empty()) {
|
||||
if (err->file && err->line) {
|
||||
error << X_("XML error: ") << msg << " in " << err->file << " at line " << err->line;
|
||||
|
||||
if (err->int2) {
|
||||
error << ':' << err->int2;
|
||||
if (err->int2) {
|
||||
error << ':' << err->int2;
|
||||
}
|
||||
|
||||
error << endmsg;
|
||||
} else {
|
||||
error << msg << endmsg;
|
||||
}
|
||||
}
|
||||
error << endmsg;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue