mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-09-15 02:01:18 -04:00
Merge pull request #53 from kiwix/zim_no_countermeta
Check that 'M/Counter' exists before trying to read it.
This commit is contained in:
commit
0343c23f82
@ -103,6 +103,7 @@ namespace kiwix {
|
||||
|
||||
zim::Article article = this->zimFileHandler->getArticle('M',"Counter");
|
||||
|
||||
if ( article.good() ) {
|
||||
stringstream ssContent(article.getData());
|
||||
|
||||
while(getline(ssContent, item, ';')) {
|
||||
@ -114,6 +115,7 @@ namespace kiwix {
|
||||
counters.insert(pair<string, int>(mimeType, counter));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return counters;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user