From 877c3f37c4ee7d4aa7ca34936f25f3eb0c7787ed Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 10 May 2012 22:45:56 +0000 Subject: [PATCH] stop crash if an error message is generated before the style RC file is loaded git-svn-id: svn://localhost/ardour2/branches/3.0@12248 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/gtkmm2ext/gtk_ui.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/libs/gtkmm2ext/gtk_ui.cc b/libs/gtkmm2ext/gtk_ui.cc index 92756c4782..3ec752af02 100644 --- a/libs/gtkmm2ext/gtk_ui.cc +++ b/libs/gtkmm2ext/gtk_ui.cc @@ -565,10 +565,15 @@ UI::process_error_message (Transmitter::Channel chn, const char *str) handle_fatal (str); } else { - display_message (prefix, prefix_len, ptag, mtag, str); - - if (!errors->is_visible() && chn != Transmitter::Info) { - show_errors (); + if (!ptag || !mtag) { + /* oops, message sent before we set up tags - don't crash */ + cerr << prefix << str << endl; + } else { + display_message (prefix, prefix_len, ptag, mtag, str); + + if (!errors->is_visible() && chn != Transmitter::Info) { + show_errors (); + } } }