Fix possible NPE from NBaseCount annotation module

This commit is contained in:
Eric Banks 2012-05-29 09:46:00 -04:00
parent 08de4dfd96
commit 50031b63c5
1 changed files with 2 additions and 1 deletions

View File

@ -30,7 +30,8 @@ public class NBaseCount extends InfoFieldAnnotation {
for( final AlignmentContext context : stratifiedContexts.values() ) {
if ( context.hasBasePileup() ) { // must be called as getBasePileup may throw error when pileup has no bases
for( final PileupElement p : context.getBasePileup()) {
if( p.getRead().getReadGroup().getPlatform().toUpperCase().contains("SOLID") ) {
final String platform = p.getRead().getReadGroup().getPlatform();
if( platform != null && platform.toUpperCase().contains("SOLID") ) {
if( BaseUtils.isNBase( p.getBase() ) ) {
countNBaseSolid++;
} else if( BaseUtils.isRegularBase( p.getBase() ) ) {