diff --git a/common/comic.cpp b/common/comic.cpp index ffb5ffaf..9a148cda 100644 --- a/common/comic.cpp +++ b/common/comic.cpp @@ -515,6 +515,10 @@ void FileComic::process() if(_firstPage == -1) _firstPage = bm->getLastPage(); + + if(_firstPage >= _pages.length()) + _firstPage = 0; + _index = _firstPage; emit(openAt(_index)); @@ -602,6 +606,9 @@ void FolderComic::process() if(_firstPage == -1) _firstPage = bm->getLastPage(); + if(_firstPage >= _pages.length()) + _firstPage = 0; + _index = _firstPage; emit(openAt(_index)); @@ -742,6 +749,10 @@ void PDFComic::process() if(_firstPage == -1) _firstPage = bm->getLastPage(); + + if(_firstPage >= _pages.length()) + _firstPage = 0; + _index = _firstPage; emit(openAt(_index));