Skip to content

Commit

Permalink
throw error if a query region doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
Zilong-Li committed Sep 23, 2024
1 parent f4c9f92 commit 90db3af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vcfpp.h
Original file line number Diff line number Diff line change
Expand Up @@ -1655,13 +1655,13 @@ class BcfReader
{
isBcf = false;
tidx = tbx_index_load(fname.c_str());
if(tidx != NULL) throw std::runtime_error("error in loading tabix index!");
if(tidx == NULL) throw std::runtime_error("error in loading tabix index!");
if(itr) tbx_itr_destroy(itr); // reset current region.
if(region.empty())
itr = tbx_itr_querys(tidx, ".");
else
itr = tbx_itr_querys(tidx, region.c_str());
if(itr != NULL) throw std::runtime_error("no interval region found!");
if(itr == NULL) throw std::runtime_error("no interval region found!");
}
}

Expand Down

0 comments on commit 90db3af

Please sign in to comment.