PluginInfo::type added to copy constructor. But why is the copy constructor defined...
[ardour.git] / libs / ardour / session_command.cc
index d7fc80aa4b9b8cd2a39771a22bc59392a605529d..e7bafc986f83542291378711f371b69a0f49aba1 100644 (file)
@@ -68,7 +68,7 @@ Session::memento_command_factory(XMLNode *n)
            before = new XMLNode(*n->children().front());
            after = new XMLNode(*n->children().back());
            child = before;
-    }
+    } 
                    
     if (!child)
     {
@@ -81,14 +81,15 @@ Session::memento_command_factory(XMLNode *n)
     if (obj_T == typeid (AudioRegion).name() || obj_T == typeid (Region).name()) {
            if (audio_regions.count(id)) {
                    return new MementoCommand<AudioRegion>(*audio_regions[id], before, after);
-           } else {
-                   cerr << "count failed for " << id << " though we have " << audio_regions.size() << endl;
            }
     } else if (obj_T == typeid (AudioSource).name()) {
            if (audio_sources.count(id))
                    return new MementoCommand<AudioSource>(*audio_sources[id], before, after);
     } else if (obj_T == typeid (Location).name()) {
-           return new MementoCommand<Location>(*_locations.get_location_by_id(id), before, after);
+           Location* loc = _locations.get_location_by_id(id);
+           if (loc) {
+                   return new MementoCommand<Location>(*loc, before, after);
+           }
     } else if (obj_T == typeid (Locations).name()) {
            return new MementoCommand<Locations>(_locations, before, after);
     } else if (obj_T == typeid (TempoMap).name()) {