Add a safety check before accessing lists in the comic flow

This commit is contained in:
Luis Ángel San Martín
2023-10-25 20:56:44 +02:00
parent 9f38fc45d3
commit 74c16f5c81
2 changed files with 9 additions and 1 deletions

View File

@ -1267,6 +1267,10 @@ void YACReaderComicFlowGL::resortCovers(QList<int> newOrder)
int index = 0;
foreach (int i, newOrder) {
if (i < 0 || i >= images.size()) {
continue;
}
pathsNew << paths.at(i);
loadedNew << loaded.at(i);
marksNew << marks.at(i);