From 0385368d87ec550c671ea4c0c7c3f4d05f8f8a99 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 7 Jul 2011 21:58:56 +0000 Subject: [PATCH] fix crash with a new session git-svn-id: svn://localhost/ardour2/branches/3.0@9806 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/ardour_ui_dialogs.cc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/gtk2_ardour/ardour_ui_dialogs.cc b/gtk2_ardour/ardour_ui_dialogs.cc index 8c1c811674..e3cb0c7e1a 100644 --- a/gtk2_ardour/ardour_ui_dialogs.cc +++ b/gtk2_ardour/ardour_ui_dialogs.cc @@ -64,11 +64,15 @@ ARDOUR_UI::set_session (Session *s) return; } - const XMLNodeList& children = _session->extra_xml (X_("UI"))->children(); - for (XMLNodeList::const_iterator i = children.begin(); i != children.end(); ++i) { - if ((*i)->name() == GUIObjectState::xml_node_name) { - gui_object_state->load (**i); - break; + const XMLNode* node = _session->extra_xml (X_("UI")); + + if (node) { + const XMLNodeList& children = node->children(); + for (XMLNodeList::const_iterator i = children.begin(); i != children.end(); ++i) { + if ((*i)->name() == GUIObjectState::xml_node_name) { + gui_object_state->load (**i); + break; + } } }