diff --git a/src/lib/workflow/DualFastq2SamWorkflow.cpp b/src/lib/workflow/DualFastq2SamWorkflow.cpp index e8878f2..193fb9e 100644 --- a/src/lib/workflow/DualFastq2SamWorkflow.cpp +++ b/src/lib/workflow/DualFastq2SamWorkflow.cpp @@ -45,7 +45,14 @@ align::InsertSizeParameters DualFastq2SamWorkflow::requestInsertSizeInfo( align::InsertSizeParameters ret; bool retDone = false; - while (r1Tokenizer.next() && r2Tokenizer.next()) { + while (true) { + // Always call next() on both tokenizers, to make sure both files are read to the end. + const bool r1Next = r1Tokenizer.next(); + const bool r2Next = r2Tokenizer.next(); + if (!r1Next || !r2Next) { + break; + } + const auto& r1Token = r1Tokenizer.token(); const auto& r2Token = r2Tokenizer.token(); // std::cout << "token: " << r1Token << "-" << r2Token << "\n";