before = new XMLNode(*n->children().front());
after = new XMLNode(*n->children().back());
child = before;
- }
+ }
if (!child)
{
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()) {