Browse code

more robust check for empty read pos breaks

git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/gmapR@110225 bc3139a8-67e5-0310-9ffc-ced21a209358

Michael Lawrence authored on 02/11/2015 22:42:05
Showing1 changed files

... ...
@@ -82,9 +82,9 @@ variantSummary <- function(x, read_pos_breaks = NULL, high_base_quality = 0L,
82 82
   if (length(read_length) != 1L) {
83 83
     stop("'read_length' must be a single integer")
84 84
   }
85
-  if (!is.null(read_pos_breaks)) {
85
+  if (length(read_pos_breaks) > 0L) {
86 86
     if (!x@read_pos) {
87
-      stop("'read_pos_breaks' non-NULL, but read positions were not tallied")
87
+      stop("'read_pos_breaks' non-empty, but read positions were not tallied")
88 88
     }
89 89
     read_pos_breaks <- as.integer(read_pos_breaks)
90 90
     if (any(is.na(read_pos_breaks)))