return nullptr if a TrackReference references a track that doesn't exist
Fixes assert trying to access an array location that doesn't exist.
This commit is contained in:
@@ -108,6 +108,10 @@ const QVector<TrackOutput *> &TrackList::Tracks()
|
||||
|
||||
TrackOutput *TrackList::TrackAt(int index)
|
||||
{
|
||||
if (index < 0 || index >= track_cache_.size()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return track_cache_.at(index);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user