From: Jim Procter Date: Mon, 17 Jun 2013 09:33:11 +0000 (+0100) Subject: JAL-1318 avoid failure if SequenceI objects don't have valid dataset references X-Git-Tag: Jalview_2_9~240^2~11 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=e498cc04385671872ab98220219aaeac2ec245f2;p=jalview.git JAL-1318 avoid failure if SequenceI objects don't have valid dataset references --- diff --git a/src/jalview/analysis/Dna.java b/src/jalview/analysis/Dna.java index f0041f6..5228413 100644 --- a/src/jalview/analysis/Dna.java +++ b/src/jalview/analysis/Dna.java @@ -131,11 +131,14 @@ public class Dna { pepseqs.addElement(newseq); SequenceI ds = newseq; - while (ds.getDatasetSequence() != null) + if (dataset != null) { - ds = ds.getDatasetSequence(); + while (ds.getDatasetSequence() != null) + { + ds = ds.getDatasetSequence(); + } + dataset.addSequence(ds); } - dataset.addSequence(ds); } } if (codons.aaWidth == 0) @@ -676,7 +679,7 @@ public class Dna private static void transferCodedFeatures(SequenceI dna, SequenceI pep, MapList map, Hashtable featureTypes, Hashtable featureGroups) { - SequenceFeature[] sf = dna.getDatasetSequence().getSequenceFeatures(); + SequenceFeature[] sf = (dna.getDatasetSequence()!=null ? dna.getDatasetSequence() : dna).getSequenceFeatures(); Boolean fgstate; jalview.datamodel.DBRefEntry[] dnarefs = jalview.util.DBRefUtils .selectRefs(dna.getDBRef(),