mirror of
https://github.com/kiwix/kiwix-desktop.git
synced 2025-09-22 11:37:56 -04:00
Library::getArchive() returns non-null or throws
This commit is contained in:
parent
073dd06937
commit
2f9700db6b
@ -60,7 +60,11 @@ QString Library::openBookFromPath(const QString &zimPath)
|
||||
|
||||
std::shared_ptr<zim::Archive> Library::getArchive(const QString &zimId)
|
||||
{
|
||||
return mp_library->getArchiveById(zimId.toStdString());
|
||||
const auto archive = mp_library->getArchiveById(zimId.toStdString());
|
||||
if ( ! archive ) {
|
||||
throw std::out_of_range("ZIM file doesn't exist (or cannot be opened)");
|
||||
}
|
||||
return archive;
|
||||
}
|
||||
|
||||
std::shared_ptr<zim::Searcher> Library::getSearcher(const QString &zimId)
|
||||
|
Loading…
x
Reference in New Issue
Block a user