Kelson has submitted this change and it was merged.
Change subject: Handle the case of last article for filenameQueue is invalid.
......................................................................
Handle the case of last article for filenameQueue is invalid.
Change-Id: I970d7dc6cfbc572ed7c2b2c7e1b4d3a27cd98ce9
---
M zimwriterfs/articlesource.cpp
1 file changed, 8 insertions(+), 3 deletions(-)
Approvals:
Kelson: Verified; Looks good to me, approved
diff --git a/zimwriterfs/articlesource.cpp b/zimwriterfs/articlesource.cpp
index 06a773d..0eea3e1 100644
--- a/zimwriterfs/articlesource.cpp
+++ b/zimwriterfs/articlesource.cpp
@@ -58,6 +58,7 @@
if (article != NULL) {
delete article;
+ article = NULL;
}
if (!metadataQueue.empty()) {
@@ -69,12 +70,16 @@
article = new RedirectArticle(line);
} else if (filenameQueue.popFromQueue(path)) {
article = new FileArticle(path);
- while (article && article->isInvalid() &&
filenameQueue.popFromQueue(path)) {
+ while (article->isInvalid() && filenameQueue.popFromQueue(path)) {
delete article;
article = new FileArticle(path);
};
- } else {
- article = NULL;
+ if (article->isInvalid()) {
+ article = NULL;
+ }
+ }
+
+ if (article == NULL) {
if ( !loopOverHandlerStarted )
{
currentLoopHandler = articleHandlers.begin();
--
To view, visit https://gerrit.wikimedia.org/r/296915
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I970d7dc6cfbc572ed7c2b2c7e1b4d3a27cd98ce9
Gerrit-PatchSet: 1
Gerrit-Project: openzim
Gerrit-Branch: master
Gerrit-Owner: Mgautierfr <[email protected]>
Gerrit-Reviewer: Kelson <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits