changeset 69:1a7d804c9f8d 1.2-stable

* merge fixes from trunk
author Chris Cannam
date Thu, 29 Nov 2007 17:16:02 +0000
parents 34fef5e68a76
children a8acc7841d70
files framework/Document.cpp
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/framework/Document.cpp	Thu Nov 29 12:02:09 2007 +0000
+++ b/framework/Document.cpp	Thu Nov 29 17:16:02 2007 +0000
@@ -271,7 +271,7 @@
 //                  << (model ? model->objectName().toStdString() : "(null)") << " in layer "
 //                  << layer->objectName().toStdString() << std::endl;
 
-	if (model == oldMainModel) {
+	if (model && (model == oldMainModel)) {
 //            std::cerr << "... it uses the old main model, replacing" << std::endl;
 	    LayerFactory::getInstance()->setModel(layer, m_mainModel);
 	    continue;
@@ -285,7 +285,7 @@
 	    continue;
 	}
 	    
-	if (m_models[model].source == oldMainModel) {
+	if (m_models[model].source && (m_models[model].source == oldMainModel)) {
 
 //            std::cerr << "... it uses a model derived from the old main model, regenerating" << std::endl;
 
@@ -334,7 +334,8 @@
     }
 
     for (ModelMap::iterator i = m_models.begin(); i != m_models.end(); ++i) {
-        if (i->first->getAlignmentReference() == oldMainModel) {
+        if (oldMainModel &&
+            (i->first->getAlignmentReference() == oldMainModel)) {
             alignModel(i->first);
         }
     }