From 08c292a1c2c539f1c7f19d365c0fa9b3767f56a8 Mon Sep 17 00:00:00 2001 From: Renia Correya Date: Thu, 27 Jun 2024 11:39:30 +0100 Subject: [PATCH] JAL-4411 Fixed some test cases --- .../structure/StructureSelectionManager.java | 39 +++++++++++--------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/src/jalview/structure/StructureSelectionManager.java b/src/jalview/structure/StructureSelectionManager.java index 36c8764..cade4f6 100644 --- a/src/jalview/structure/StructureSelectionManager.java +++ b/src/jalview/structure/StructureSelectionManager.java @@ -709,23 +709,28 @@ public class StructureSelectionManager } //Match the PDB entry using file path in the pdb data model and get the provider - Vector pdbEntries = seq.getDatasetSequence().getAllPDBEntries(); - for(PDBEntry pdbEntry : pdbEntries) { - if(ssStructFilePathNameInPDB.startsWith(pdbEntry.getFile())) { - provider = pdbEntry.getProvider(); - break; - } - } - - //Add provider value as property to the ss annotation - if(provider != null) { - AlignmentAnnotation[] ssAnnotList = ds.getAnnotation(Constants.SS_ANNOTATION_LABEL); - if(ssAnnotList != null) { - for(AlignmentAnnotation ssAnnot : ssAnnotList) { - //Match the annotation description with the annotation in pdb data object - if(ssAnnot.getProperty(Constants.SS_PROVIDER_PROPERTY) == null - && ssAnnot.description.equals(ssAnnotDescriptionInPDB)) { - ssAnnot.setProperty(Constants.SS_PROVIDER_PROPERTY, provider); + if(seq.getDatasetSequence() != null) { + Vector pdbEntries = seq.getDatasetSequence().getAllPDBEntries(); + if(pdbEntries != null) { + for(PDBEntry pdbEntry : pdbEntries) { + if(ssStructFilePathNameInPDB.startsWith(pdbEntry.getFile())) { + provider = pdbEntry.getProvider(); + break; + } + } + + + //Add provider value as property to the ss annotation + if(provider != null) { + AlignmentAnnotation[] ssAnnotList = ds.getAnnotation(Constants.SS_ANNOTATION_LABEL); + if(ssAnnotList != null) { + for(AlignmentAnnotation ssAnnot : ssAnnotList) { + //Match the annotation description with the annotation in pdb data object + if(ssAnnot.getProperty(Constants.SS_PROVIDER_PROPERTY) == null + && ssAnnot.description.equals(ssAnnotDescriptionInPDB)) { + ssAnnot.setProperty(Constants.SS_PROVIDER_PROPERTY, provider); + } + } } } } -- 1.7.10.2