mirror of
https://github.com/kiwix/libkiwix.git
synced 2026-10-23 01:25:20 -04:00
Do not crash if zim file has no Counter metadata.
This commit is contained in:
1 parent
e0bcafd89a
commit
4749656828
1 file changed
+6
-2
+6
-2
@@ -93,8 +93,12 @@ zim::Archive* Reader::getZimArchive() const
|
||||
|
||||
MimeCounterType Reader::parseCounterMetadata() const
|
||||
{
|
||||
auto counterContent = zimArchive->getMetadata("Counter");
|
||||
return parseMimetypeCounter(counterContent);
|
||||
try {
|
||||
auto counterContent = zimArchive->getMetadata("Counter");
|
||||
return parseMimetypeCounter(counterContent);
|
||||
} catch (zim::EntryNotFound& e) {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
/* Get the count of articles which can be indexed/displayed */
|
||||
|
||||
Reference in new issue
Block a user