Skip to content

Commit

Permalink
Merge pull request #1 from fnothaft/fix-oc-npe
Browse files Browse the repository at this point in the history
Use option to avoid NPE in test.
  • Loading branch information
niranjan93 committed Oct 31, 2014
2 parents f0bc0f0 + 7eb8883 commit 4186c74
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -260,13 +260,12 @@ class RealignIndelsSuite extends SparkFunSuite {
val readName = realn.getReadName()
val op = realn.getOldPosition()
val oc = realn.getOldCigar()
if (op != null && op > 0) {

Option(op).filter(_ >= 0).foreach(oPos => {
val s = artificial_reads.collect().filter(x => (x.getReadName() == readName))
assert(oc != null)
assert(s.filter(x => (x.getStart() == op)).length > 0)
assert(s.filter(x => (x.getStart() == oPos)).length > 0)
assert(s.filter(x => (x.getCigar() == oc)).length > 0)
}
})
})
}

}

0 comments on commit 4186c74

Please sign in to comment.