diff --git a/vcfpp.h b/vcfpp.h index 19231ce..fd9acf5 100644 --- a/vcfpp.h +++ b/vcfpp.h @@ -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!"); } }