Don't attempt attempt to render a comic we were unable load.

Fixes segfaults occuring when supplying YACReader with non-existent or
faulty paths.
This commit is contained in:
Felix Kauselmann
2014-08-08 21:04:34 +02:00
parent 1f4f524397
commit 2c0703fba5

View File

@ -609,8 +609,11 @@ void Render::update()
void Render::load(const QString & path, int atPage) void Render::load(const QString & path, int atPage)
{ {
createComic(path); createComic(path);
loadComic(path,atPage); if (comic !=0)
startLoad(); {
loadComic(path,atPage);
startLoad();
}
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -636,8 +639,11 @@ void Render::load(const QString & path, const ComicDB & comicDB)
filters[i]->setLevel(comicDB.info.gamma); filters[i]->setLevel(comicDB.info.gamma);
} }
createComic(path); createComic(path);
loadComic(path,comicDB); if (comic!=0)
startLoad(); {
loadComic(path,comicDB);
startLoad();
}
} }
void Render::createComic(const QString & path) void Render::createComic(const QString & path)