changeset 1623:987b406be4b0

Fix crash when trying to set object name on nonexistent model
author Chris Cannam
date Tue, 28 Feb 2017 09:27:34 +0000
parents 239e95ccdbfd
children 2fb4002b776c
files main/MainWindow.cpp
diffstat 1 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/main/MainWindow.cpp	Mon Feb 27 16:52:47 2017 +0000
+++ b/main/MainWindow.cpp	Tue Feb 28 09:27:34 2017 +0000
@@ -3959,12 +3959,14 @@
          duration,
          &configurator);
 
-    if (input.getModel() == aggregate) {
-        aggregate->setObjectName(tr("Multiplexed audio"));
-        m_document->addAggregateModel(aggregate);
-    } else {
-        aggregate->aboutToDelete();
-        delete aggregate;
+    if (aggregate) {
+        if (input.getModel() == aggregate) {
+            aggregate->setObjectName(tr("Multiplexed audio"));
+            m_document->addAggregateModel(aggregate);
+        } else {
+            aggregate->aboutToDelete();
+            delete aggregate;
+        }
     }
     
     if (!input.getModel()) return;