]> git.donarmstrong.com Git - bamtools.git/blobdiff - src/toolkit/bamtools_count.cpp
added reader.Open checks to a number of tools
[bamtools.git] / src / toolkit / bamtools_count.cpp
index 20ed3ae7bd7d7552b21039157635ce822a68a01f..9d6623b3604cb79bb4dc54fa375c50660f67114e 100644 (file)
@@ -80,7 +80,10 @@ int CountTool::Run(int argc, char* argv[]) {
     
     // open reader without index
     BamMultiReader reader;
-    reader.Open(m_settings->InputFiles, false, true);
+    if (!reader.Open(m_settings->InputFiles, false, true)) {
+        cerr << "ERROR: Could not open input BAM file(s)... Aborting." << endl;
+        return 1;
+    }
 
     // alignment counter
     BamAlignment al;