From f14112a775d37cc1848348d540c15b17bf56c2f4 Mon Sep 17 00:00:00 2001 From: itsmattkc <34096995+itsmattkc@users.noreply.github.com> Date: Sat, 16 Jul 2022 18:37:27 -0700 Subject: [PATCH] track: check for negative values too --- app/node/output/track/tracklist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/node/output/track/tracklist.cpp b/app/node/output/track/tracklist.cpp index 3149d973b..6759d54b5 100644 --- a/app/node/output/track/tracklist.cpp +++ b/app/node/output/track/tracklist.cpp @@ -38,7 +38,7 @@ TrackList::TrackList(Sequence *parent, const Track::Type &type, const QString &t Track *TrackList::GetTrackAt(int index) const { - if (index < track_cache_.size()) { + if (index >= 0 && index < track_cache_.size()) { return track_cache_.at(index); } else { return nullptr;