From: pvtroshin Date: Tue, 8 Nov 2011 16:19:29 +0000 (+0000) Subject: Fix for potential NullPointer exception if the results are an empty file X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=492f08c6b3e82dbd424a3f4138da8f191749758d;p=jabaws.git Fix for potential NullPointer exception if the results are an empty file git-svn-id: link to svn.lifesci.dundee.ac.uk/svn/barton/ptroshin/JABA2@4721 e3abac25-378b-4346-85de-24260fe3988d --- diff --git a/datamodel/compbio/data/sequence/ScoreManager.java b/datamodel/compbio/data/sequence/ScoreManager.java index cabf507..d16a059 100644 --- a/datamodel/compbio/data/sequence/ScoreManager.java +++ b/datamodel/compbio/data/sequence/ScoreManager.java @@ -116,7 +116,13 @@ public class ScoreManager { } public void writeOut(Writer outStream) throws IOException { + assert outStream != null : "Output steam is not defined!"; + if (seqScores == null) { + return; + } for (ScoreHolder oneSeqScores : seqScores) { + if (oneSeqScores == null) + continue; oneSeqScores.writeOut(outStream); } } @@ -220,4 +226,5 @@ public class ScoreManager { } } + }