Skip to content

Commit

Permalink
Merge pull request #14 from maxrossi91/main
Browse files Browse the repository at this point in the history
Fix livelock if FASTA reference does not exist.
  • Loading branch information
milkschen authored Jun 18, 2022
2 parents 0f7c0a6 + 2b0007c commit d9cc2a5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/leviosam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,10 @@ std::map<std::string, std::string> load_fasta(std::string ref_name) {
std::cerr << "[I::load_fasta] Loading FASTA...";
std::map<std::string, std::string> fmap;
gzFile fp = gzopen(ref_name.data(), "r");
if (!fp) {
std::cerr << "\n[E::load_fasta] Cannot open file " << ref_name << ".\n";
exit(1);
}
kseq_t *seq;
seq = kseq_init(fp);
while (kseq_read(seq) >= 0) {
Expand Down

0 comments on commit d9cc2a5

Please sign in to comment.