X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fviewmodel%2FAlignmentViewport.java;fp=src%2Fjalview%2Fviewmodel%2FAlignmentViewport.java;h=6322243d9dede0ce4f3abd3156ccf0252e2d686a;hb=b2cedc8371f6624859f107581e6d84e841d4114b;hp=07cb689a891a5e84af44cb865e68cf6b95df4a7d;hpb=0e5be6925629dad5a92036d728f8856fde2d5488;p=jalview.git diff --git a/src/jalview/viewmodel/AlignmentViewport.java b/src/jalview/viewmodel/AlignmentViewport.java index 07cb689..6322243 100644 --- a/src/jalview/viewmodel/AlignmentViewport.java +++ b/src/jalview/viewmodel/AlignmentViewport.java @@ -49,6 +49,7 @@ import jalview.structure.CommandListener; import jalview.structure.StructureSelectionManager; import jalview.structure.VamsasSource; import jalview.util.Comparison; +import jalview.util.MapList; import jalview.util.MappingUtils; import jalview.viewmodel.styles.ViewStyle; import jalview.workers.AlignCalcManager; @@ -848,7 +849,9 @@ public abstract class AlignmentViewport implements AlignViewportI, */ AlignedCodonFrame mapping = al.getCodonFrames().iterator().next(); // TODO hold mapping type e.g. dna-to-protein in AlignedCodonFrame? - if (mapping.getdnaToProt()[0].getFromRatio() == 3) + MapList[] mapLists = mapping.getdnaToProt(); + // mapLists can be empty if project load has not finished resolving seqs + if (mapLists.length > 0 && mapLists[0].getFromRatio() == 3) { if (calculator .getRegisteredWorkersOfClass(ComplementConsensusThread.class) == null) @@ -1797,7 +1800,9 @@ public abstract class AlignmentViewport implements AlignViewportI, // fudge: check mappings are not protein-to-protein // TODO: nicer AlignedCodonFrame mapping = codonMappings.iterator().next(); - if (mapping.getdnaToProt()[0].getFromRatio() == 3) + MapList[] mapLists = mapping.getdnaToProt(); + // mapLists can be empty if project load has not finished resolving seqs + if (mapLists.length > 0 && mapLists[0].getFromRatio() == 3) { complementConsensus = new AlignmentAnnotation("cDNA Consensus", "PID for cDNA", new Annotation[1], 0f, 100f,