libtemporal: fix crash caused by thinko

This commit is contained in:
Paul Davis
2021-02-07 23:15:30 -07:00
parent 388fa1b894
commit 1035f9bd62

View File

@@ -1086,13 +1086,13 @@ TempoMap::reset_starting_at (superclock_t sc)
TempoMetric metric (*current_tempo, *current_meter);
if (m->sclock() == first_of_three->sclock()) {
if (m != _meters.end() && m->sclock() == first_of_three->sclock()) {
advance_meter = true;
current_meter = &*m;
DEBUG_TRACE (DEBUG::TemporalMap, string_compose ("\tcurrent point defines meter %1\n", *current_meter));
}
if (t->sclock() == first_of_three->sclock()) {
if (t != _tempos.end() && t->sclock() == first_of_three->sclock()) {
advance_tempo = true;
current_tempo = &*t;
DEBUG_TRACE (DEBUG::TemporalMap, string_compose ("\tcurrent point defines tempo %1\n", *current_tempo));