handle searching for a note in an empty note list
git-svn-id: svn://localhost/ardour2/branches/3.0@5822 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
@@ -719,10 +719,15 @@ MidiModel::get_state()
|
||||
boost::shared_ptr<Evoral::Note<MidiModel::TimeType> >
|
||||
MidiModel::find_note (boost::shared_ptr<Evoral::Note<TimeType> > other)
|
||||
{
|
||||
for (Notes::iterator l = notes().lower_bound(other); (*l)->time() == other->time(); ++l) {
|
||||
if (*l == other) {
|
||||
return *l;
|
||||
Notes::iterator l = notes().lower_bound(other);
|
||||
|
||||
if (l != notes().end()) {
|
||||
for (; (*l)->time() == other->time(); ++l) {
|
||||
if (*l == other) {
|
||||
return *l;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return boost::shared_ptr<Evoral::Note<TimeType> >();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user