mirror of https://github.com/kiwix/libkiwix.git
Do not crash if zim file has no `Counter` metadata.
This commit is contained in:
parent
e0bcafd89a
commit
4749656828
|
@ -93,8 +93,12 @@ zim::Archive* Reader::getZimArchive() const
|
||||||
|
|
||||||
MimeCounterType Reader::parseCounterMetadata() const
|
MimeCounterType Reader::parseCounterMetadata() const
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
auto counterContent = zimArchive->getMetadata("Counter");
|
auto counterContent = zimArchive->getMetadata("Counter");
|
||||||
return parseMimetypeCounter(counterContent);
|
return parseMimetypeCounter(counterContent);
|
||||||
|
} catch (zim::EntryNotFound& e) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get the count of articles which can be indexed/displayed */
|
/* Get the count of articles which can be indexed/displayed */
|
||||||
|
|
Loading…
Reference in New Issue