Fix crash when the comics view content is empty after an update

This commit is contained in:
Luis Ángel San Martín 2024-11-03 15:40:45 +01:00
parent 4fbaa881df
commit f4ec6c8927
2 changed files with 8 additions and 0 deletions

View File

@ -18,6 +18,7 @@ Version counting is based on semantic versioning (Major.Feature.Patch)
* New setting to open comics in third party reader apps, it works by entering a command that will launch the app, e.g. "/path/to/the/app {comic_file_path}". You can use `{comic_file_path}` as a placeholder where `YACReaderLibrary` will place thet path to the comic file.
* Purge covers and metadata not being used after a full library update.
* Fix crash when updating the current folder content after a library update.
* Fix crash when current folders is empty after an update.
### YACReaderLibraryServer
* New command --system-info to print information about the execution environment and available resources (including what image formats are supported and what libraries are used by the app).

View File

@ -63,6 +63,13 @@ void ComicsView::updateInfoForIndex(int index)
if (comicDB != nullptr)
delete comicDB;
if ((index < 0) || (index >= model->rowCount())) {
ctxt->setContextProperty("comic", nullptr);
ctxt->setContextProperty("comicInfo", nullptr);
ctxt->setContextProperty("comic_info_index", -1);
return;
}
comicDB = new ComicDB(model->getComic(this->model->index(index, 0)));
ComicInfo *comicInfo = &(comicDB->info);
comicInfo->isFavorite = model->isFavorite(model->index(index, 0));