Merge pull request #53 from kiwix/zim_no_countermeta

Check that 'M/Counter' exists before trying to read it.
This commit is contained in:
Matthieu Gautier 2017-05-23 17:37:07 +02:00 committed by GitHub
commit 0343c23f82
1 changed files with 10 additions and 8 deletions

View File

@ -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;
}