diff base/CommandHistory.cpp @ 383:94fc0591ea43 1.2-stable

* merge from trunk (1.2 ended up being tracked from trunk, but we may want this branch for fixes later)
author Chris Cannam
date Wed, 27 Feb 2008 10:32:45 +0000
parents dc46851837d6
children
line wrap: on
line diff
--- a/base/CommandHistory.cpp	Fri Nov 30 17:36:14 2007 +0000
+++ b/base/CommandHistory.cpp	Wed Feb 27 10:32:45 2008 +0000
@@ -216,6 +216,10 @@
 CommandHistory::addToCompound(Command *command, bool execute)
 {
 //    std::cerr << "CommandHistory::addToCompound: " << command->getName().toLocal8Bit().data() << std::endl;
+    if (!m_currentCompound) {
+	std::cerr << "CommandHistory::addToCompound: ERROR: no compound operation in progress!" << std::endl;
+        return;
+    }
 
     if (execute) command->execute();
     m_currentCompound->addCommand(command);
@@ -227,6 +231,7 @@
     if (m_currentCompound) {
 	std::cerr << "CommandHistory::startCompoundOperation: ERROR: compound operation already in progress!" << std::endl;
 	std::cerr << "(name is " << m_currentCompound->getName().toLocal8Bit().data() << ")" << std::endl;
+        return;
     }
  
     closeBundle();
@@ -240,6 +245,7 @@
 {
     if (!m_currentCompound) {
 	std::cerr << "CommandHistory::endCompoundOperation: ERROR: no compound operation in progress!" << std::endl;
+        return;
     }
 
     MacroCommand *toAdd = m_currentCompound;