summaryrefslogtreecommitdiff
path: root/gtk2_ardour/ardour_ui.cc
diff options
context:
space:
mode:
authorJohn Emmas <johne53@tiscali.co.uk>2016-04-21 16:45:15 +0100
committerJohn Emmas <johne53@tiscali.co.uk>2016-04-21 16:45:15 +0100
commitfba9dc8c05478365fde8ddee60aad3260757b883 (patch)
treee72c67db4c504fe2765392c01bca854dce8bd19d /gtk2_ardour/ardour_ui.cc
parent238cec8549ecb6fa68a8d57211aa90411ed98f27 (diff)
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!
Diffstat (limited to 'gtk2_ardour/ardour_ui.cc')
-rw-r--r--gtk2_ardour/ardour_ui.cc15
1 files changed, 10 insertions, 5 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index d221db743c..ea0586f5ce 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -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;
}