track: fixed segfault if user tried to use "add" tool on nonexistant track

This commit is contained in:
itsmattkc
2020-05-05 00:36:28 +10:00
parent 63f3e542ee
commit b80eb6fd45
+5 -1
View File
@@ -57,7 +57,11 @@ const QVector<TrackOutput *> &TrackList::GetTracks() const
TrackOutput *TrackList::GetTrackAt(int index) const
{
return track_cache_.at(index);
if (index < track_cache_.size()) {
return track_cache_.at(index);
} else {
return nullptr;
}
}
const rational &TrackList::GetTotalLength() const