mirror of https://github.com/kiwix/libkiwix.git
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…
Reference in New Issue