X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=sam%2Ffaidx.c;h=51c82ac1dfdcd0baf31435a0fe5f8e45c3289d0f;hb=dbcf1cfb8ad1086c21d64e249f012809403e7ddc;hp=f0798fccc8057a5e33fdb04afaae1af084badbc9;hpb=fc69cf6af24c0550e55447fc82f01cb6f90c1c42;p=rsem.git diff --git a/sam/faidx.c b/sam/faidx.c index f0798fc..51c82ac 100644 --- a/sam/faidx.c +++ b/sam/faidx.c @@ -337,6 +337,11 @@ char *fai_fetch(const faidx_t *fai, const char *str, int *len) } else s[name_end] = ':', name_end = l; } } else iter = kh_get(s, h, str); + if(iter == kh_end(h)) { + fprintf(stderr, "[fai_fetch] Warning - Reference %s not found in FASTA file, returning empty sequence\n", str); + free(s); + return 0; + }; val = kh_value(h, iter); // parse the interval if (name_end < l) {