Skip to content

Commit

Permalink
fix segfault when the VCF contains no records
Browse files Browse the repository at this point in the history
  • Loading branch information
jts committed Aug 12, 2021
1 parent fc2a19a commit 0a03af4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions artic/vcfCheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,10 @@ void artic::VcfChecker::Run()
_getRecordStats();
}

// get stats from final record
_getRecordStats();
// get stats from final record, if there was one
if(_numValid > 0) {
_getRecordStats();
}

// write the stats to the report file
std::ofstream outputReport;
Expand All @@ -255,4 +257,4 @@ unsigned int artic::VcfChecker::GetNumInPrimerSite(void) const { return _numPrim
unsigned int artic::VcfChecker::GetNumInOverlap(void) const { return _numAmpOverlap; }

// GetNumLowQual returns the number of records with low quality.
unsigned int artic::VcfChecker::GetNumLowQual(void) const { return _numLowQual; }
unsigned int artic::VcfChecker::GetNumLowQual(void) const { return _numLowQual; }

0 comments on commit 0a03af4

Please sign in to comment.