X-Git-Url: https://git.donarmstrong.com/?p=bamtools.git;a=blobdiff_plain;f=src%2Fapi%2FBamAlignment.cpp;h=c95e896c7333d527d726c953a7fcd660f7f42ffc;hp=013937a99e7bd96fb44e1249d7c7fe4d2a1966ff;hb=c3a7c31347d42a926214e2508d713975d124e8c6;hpb=f82b860f94f9bf107c21acacf9df5aab6cf8c3e7 diff --git a/src/api/BamAlignment.cpp b/src/api/BamAlignment.cpp index 013937a..c95e896 100644 --- a/src/api/BamAlignment.cpp +++ b/src/api/BamAlignment.cpp @@ -365,9 +365,18 @@ bool BamAlignment::FindTag(const std::string& tag, return true; // get the storage class and find the next tag - if ( *pTagStorageType == '\0' ) return false; - if ( !SkipToNextTag(*pTagStorageType, pTagData, numBytesParsed) ) return false; - if ( *pTagData == '\0' ) return false; + if ( *pTagStorageType == '\0' ) { + ErrorString = "unexpected null found - 1"; + return false; + } + if ( !SkipToNextTag(*pTagStorageType, pTagData, numBytesParsed) ) { + ErrorString = "could not skip to next tag"; + return false; + } + if ( *pTagData == '\0' ) { + ErrorString = "unexpected null found - 2"; + return false; + } } // checked all tags, none match