# HG changeset patch # User Chris Cannam # Date 1196356562 0 # Node ID 1a7d804c9f8db93fb842b9099dbf655f6c06fc0a # Parent 34fef5e68a76e555be8b4d8974eef40652371b46 * merge fixes from trunk diff -r 34fef5e68a76 -r 1a7d804c9f8d framework/Document.cpp --- 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); } }