]> git.donarmstrong.com Git - bamtools.git/blobdiff - src/api/BamAlignment.cpp
Regression fixed: error in BamAlignment tag access methods
[bamtools.git] / src / api / BamAlignment.cpp
index 013937a99e7bd96fb44e1249d7c7fe4d2a1966ff..c95e896c7333d527d726c953a7fcd660f7f42ffc 100644 (file)
@@ -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