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:
itsmattkc
2019-11-19 22:24:23 +09:00
parent 54ecc01dbe
commit 065fbc0428
+4
View File
@@ -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);
}